From 81677cff354241d76de2533aba4bc149675d34d5 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 18:41:01 +0000 Subject: [PATCH 1/8] Update generated code for v1789 and 2025-05-28.basil --- API_VERSION | 1 + OPENAPI_VERSION | 2 +- stripe/__init__.py | 1 + stripe/_stripe_client.py | 564 +- stripe/_v1_services.py | 160 + tests/test_generated_examples.py | 12964 ++++++++++++++++++++++++++--- 6 files changed, 12363 insertions(+), 1329 deletions(-) create mode 100644 API_VERSION create mode 100644 stripe/_v1_services.py diff --git a/API_VERSION b/API_VERSION new file mode 100644 index 000000000..41f75f9ac --- /dev/null +++ b/API_VERSION @@ -0,0 +1 @@ +2025-05-28.basil \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3108db19f..da86bc739 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1773 \ No newline at end of file +v1789 \ No newline at end of file diff --git a/stripe/__init__.py b/stripe/__init__.py index 5b98fd411..4aea00eae 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -567,6 +567,7 @@ def __getattr__(name): ) from stripe._transfer_service import TransferService as TransferService from stripe._treasury_service import TreasuryService as TreasuryService +from stripe._v1_services import V1Services as V1Services from stripe._v2_services import V2Services as V2Services from stripe._webhook_endpoint import WebhookEndpoint as WebhookEndpoint from stripe._webhook_endpoint_service import ( diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index e39f39534..2cb5ed60a 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -35,6 +35,8 @@ from stripe._oauth_service import OAuthService # services: The beginning of the section generated from our OpenAPI spec +from stripe._v1_services import V1Services +from stripe._v2_services import V2Services from stripe._account_service import AccountService from stripe._account_link_service import AccountLinkService from stripe._account_session_service import AccountSessionService @@ -108,7 +110,6 @@ from stripe._transfer_service import TransferService from stripe._treasury_service import TreasuryService from stripe._webhook_endpoint_service import WebhookEndpointService -from stripe._v2_services import V2Services # services: The end of the section generated from our OpenAPI spec @@ -186,85 +187,7 @@ def __init__( 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_payments = InvoicePaymentService(self._requestor) - self.invoice_rendering_templates = InvoiceRenderingTemplateService( - 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) + self.v1 = V1Services(self._requestor) self.v2 = V2Services(self._requestor) # top-level services: The end of the section generated from our OpenAPI spec @@ -372,4 +295,485 @@ def deserialize( ) # deprecated v1 services: The beginning of the section generated from our OpenAPI spec + @property + @deprecated( + "stripe_client.accounts is deprecated. Use stripe_client.v1.accounts.", + ) + def accounts(self) -> AccountService: + return self.v1.accounts + + @property + @deprecated( + "stripe_client.account_links is deprecated. Use stripe_client.v1.account_links.", + ) + def account_links(self) -> AccountLinkService: + return self.v1.account_links + + @property + @deprecated( + "stripe_client.account_sessions is deprecated. Use stripe_client.v1.account_sessions.", + ) + def account_sessions(self) -> AccountSessionService: + return self.v1.account_sessions + + @property + @deprecated( + "stripe_client.apple_pay_domains is deprecated. Use stripe_client.v1.apple_pay_domains.", + ) + def apple_pay_domains(self) -> ApplePayDomainService: + return self.v1.apple_pay_domains + + @property + @deprecated( + "stripe_client.application_fees is deprecated. Use stripe_client.v1.application_fees.", + ) + def application_fees(self) -> ApplicationFeeService: + return self.v1.application_fees + + @property + @deprecated("stripe_client.apps is deprecated. Use stripe_client.v1.apps.") + def apps(self) -> AppsService: + return self.v1.apps + + @property + @deprecated( + "stripe_client.balance is deprecated. Use stripe_client.v1.balance.", + ) + def balance(self) -> BalanceService: + return self.v1.balance + + @property + @deprecated( + "stripe_client.balance_transactions is deprecated. Use stripe_client.v1.balance_transactions.", + ) + def balance_transactions(self) -> BalanceTransactionService: + return self.v1.balance_transactions + + @property + @deprecated( + "stripe_client.billing is deprecated. Use stripe_client.v1.billing.", + ) + def billing(self) -> BillingService: + return self.v1.billing + + @property + @deprecated( + "stripe_client.billing_portal is deprecated. Use stripe_client.v1.billing_portal.", + ) + def billing_portal(self) -> BillingPortalService: + return self.v1.billing_portal + + @property + @deprecated( + "stripe_client.charges is deprecated. Use stripe_client.v1.charges.", + ) + def charges(self) -> ChargeService: + return self.v1.charges + + @property + @deprecated( + "stripe_client.checkout is deprecated. Use stripe_client.v1.checkout.", + ) + def checkout(self) -> CheckoutService: + return self.v1.checkout + + @property + @deprecated( + "stripe_client.climate is deprecated. Use stripe_client.v1.climate.", + ) + def climate(self) -> ClimateService: + return self.v1.climate + + @property + @deprecated( + "stripe_client.confirmation_tokens is deprecated. Use stripe_client.v1.confirmation_tokens.", + ) + def confirmation_tokens(self) -> ConfirmationTokenService: + return self.v1.confirmation_tokens + + @property + @deprecated( + "stripe_client.test_helpers is deprecated. Use stripe_client.v1.test_helpers.", + ) + def test_helpers(self) -> TestHelpersService: + return self.v1.test_helpers + + @property + @deprecated( + "stripe_client.country_specs is deprecated. Use stripe_client.v1.country_specs.", + ) + def country_specs(self) -> CountrySpecService: + return self.v1.country_specs + + @property + @deprecated( + "stripe_client.coupons is deprecated. Use stripe_client.v1.coupons.", + ) + def coupons(self) -> CouponService: + return self.v1.coupons + + @property + @deprecated( + "stripe_client.credit_notes is deprecated. Use stripe_client.v1.credit_notes.", + ) + def credit_notes(self) -> CreditNoteService: + return self.v1.credit_notes + + @property + @deprecated( + "stripe_client.customers is deprecated. Use stripe_client.v1.customers.", + ) + def customers(self) -> CustomerService: + return self.v1.customers + + @property + @deprecated( + "stripe_client.customer_sessions is deprecated. Use stripe_client.v1.customer_sessions.", + ) + def customer_sessions(self) -> CustomerSessionService: + return self.v1.customer_sessions + + @property + @deprecated( + "stripe_client.disputes is deprecated. Use stripe_client.v1.disputes.", + ) + def disputes(self) -> DisputeService: + return self.v1.disputes + + @property + @deprecated( + "stripe_client.entitlements is deprecated. Use stripe_client.v1.entitlements.", + ) + def entitlements(self) -> EntitlementsService: + return self.v1.entitlements + + @property + @deprecated( + "stripe_client.ephemeral_keys is deprecated. Use stripe_client.v1.ephemeral_keys.", + ) + def ephemeral_keys(self) -> EphemeralKeyService: + return self.v1.ephemeral_keys + + @property + @deprecated( + "stripe_client.events is deprecated. Use stripe_client.v1.events." + ) + def events(self) -> EventService: + return self.v1.events + + @property + @deprecated( + "stripe_client.exchange_rates is deprecated. Use stripe_client.v1.exchange_rates.", + ) + def exchange_rates(self) -> ExchangeRateService: + return self.v1.exchange_rates + + @property + @deprecated( + "stripe_client.files is deprecated. Use stripe_client.v1.files." + ) + def files(self) -> FileService: + return self.v1.files + + @property + @deprecated( + "stripe_client.file_links is deprecated. Use stripe_client.v1.file_links.", + ) + def file_links(self) -> FileLinkService: + return self.v1.file_links + + @property + @deprecated( + "stripe_client.financial_connections is deprecated. Use stripe_client.v1.financial_connections.", + ) + def financial_connections(self) -> FinancialConnectionsService: + return self.v1.financial_connections + + @property + @deprecated( + "stripe_client.forwarding is deprecated. Use stripe_client.v1.forwarding.", + ) + def forwarding(self) -> ForwardingService: + return self.v1.forwarding + + @property + @deprecated( + "stripe_client.identity is deprecated. Use stripe_client.v1.identity.", + ) + def identity(self) -> IdentityService: + return self.v1.identity + + @property + @deprecated( + "stripe_client.invoices is deprecated. Use stripe_client.v1.invoices.", + ) + def invoices(self) -> InvoiceService: + return self.v1.invoices + + @property + @deprecated( + "stripe_client.invoice_payments is deprecated. Use stripe_client.v1.invoice_payments.", + ) + def invoice_payments(self) -> InvoicePaymentService: + return self.v1.invoice_payments + + @property + @deprecated( + "stripe_client.invoice_rendering_templates is deprecated. Use stripe_client.v1.invoice_rendering_templates.", + ) + def invoice_rendering_templates(self) -> InvoiceRenderingTemplateService: + return self.v1.invoice_rendering_templates + + @property + @deprecated( + "stripe_client.invoice_items is deprecated. Use stripe_client.v1.invoice_items.", + ) + def invoice_items(self) -> InvoiceItemService: + return self.v1.invoice_items + + @property + @deprecated( + "stripe_client.issuing is deprecated. Use stripe_client.v1.issuing.", + ) + def issuing(self) -> IssuingService: + return self.v1.issuing + + @property + @deprecated( + "stripe_client.mandates is deprecated. Use stripe_client.v1.mandates.", + ) + def mandates(self) -> MandateService: + return self.v1.mandates + + @property + @deprecated( + "stripe_client.payment_intents is deprecated. Use stripe_client.v1.payment_intents.", + ) + def payment_intents(self) -> PaymentIntentService: + return self.v1.payment_intents + + @property + @deprecated( + "stripe_client.payment_links is deprecated. Use stripe_client.v1.payment_links.", + ) + def payment_links(self) -> PaymentLinkService: + return self.v1.payment_links + + @property + @deprecated( + "stripe_client.payment_methods is deprecated. Use stripe_client.v1.payment_methods.", + ) + def payment_methods(self) -> PaymentMethodService: + return self.v1.payment_methods + + @property + @deprecated( + "stripe_client.payment_method_configurations is deprecated. Use stripe_client.v1.payment_method_configurations.", + ) + def payment_method_configurations( + self, + ) -> PaymentMethodConfigurationService: + return self.v1.payment_method_configurations + + @property + @deprecated( + "stripe_client.payment_method_domains is deprecated. Use stripe_client.v1.payment_method_domains.", + ) + def payment_method_domains(self) -> PaymentMethodDomainService: + return self.v1.payment_method_domains + + @property + @deprecated( + "stripe_client.payouts is deprecated. Use stripe_client.v1.payouts.", + ) + def payouts(self) -> PayoutService: + return self.v1.payouts + + @property + @deprecated( + "stripe_client.plans is deprecated. Use stripe_client.v1.plans." + ) + def plans(self) -> PlanService: + return self.v1.plans + + @property + @deprecated( + "stripe_client.prices is deprecated. Use stripe_client.v1.prices." + ) + def prices(self) -> PriceService: + return self.v1.prices + + @property + @deprecated( + "stripe_client.products is deprecated. Use stripe_client.v1.products.", + ) + def products(self) -> ProductService: + return self.v1.products + + @property + @deprecated( + "stripe_client.promotion_codes is deprecated. Use stripe_client.v1.promotion_codes.", + ) + def promotion_codes(self) -> PromotionCodeService: + return self.v1.promotion_codes + + @property + @deprecated( + "stripe_client.quotes is deprecated. Use stripe_client.v1.quotes." + ) + def quotes(self) -> QuoteService: + return self.v1.quotes + + @property + @deprecated( + "stripe_client.radar is deprecated. Use stripe_client.v1.radar." + ) + def radar(self) -> RadarService: + return self.v1.radar + + @property + @deprecated( + "stripe_client.refunds is deprecated. Use stripe_client.v1.refunds.", + ) + def refunds(self) -> RefundService: + return self.v1.refunds + + @property + @deprecated( + "stripe_client.reporting is deprecated. Use stripe_client.v1.reporting.", + ) + def reporting(self) -> ReportingService: + return self.v1.reporting + + @property + @deprecated( + "stripe_client.reviews is deprecated. Use stripe_client.v1.reviews.", + ) + def reviews(self) -> ReviewService: + return self.v1.reviews + + @property + @deprecated( + "stripe_client.sigma is deprecated. Use stripe_client.v1.sigma." + ) + def sigma(self) -> SigmaService: + return self.v1.sigma + + @property + @deprecated( + "stripe_client.setup_attempts is deprecated. Use stripe_client.v1.setup_attempts.", + ) + def setup_attempts(self) -> SetupAttemptService: + return self.v1.setup_attempts + + @property + @deprecated( + "stripe_client.setup_intents is deprecated. Use stripe_client.v1.setup_intents.", + ) + def setup_intents(self) -> SetupIntentService: + return self.v1.setup_intents + + @property + @deprecated( + "stripe_client.shipping_rates is deprecated. Use stripe_client.v1.shipping_rates.", + ) + def shipping_rates(self) -> ShippingRateService: + return self.v1.shipping_rates + + @property + @deprecated( + "stripe_client.sources is deprecated. Use stripe_client.v1.sources.", + ) + def sources(self) -> SourceService: + return self.v1.sources + + @property + @deprecated( + "stripe_client.subscriptions is deprecated. Use stripe_client.v1.subscriptions.", + ) + def subscriptions(self) -> SubscriptionService: + return self.v1.subscriptions + + @property + @deprecated( + "stripe_client.subscription_items is deprecated. Use stripe_client.v1.subscription_items.", + ) + def subscription_items(self) -> SubscriptionItemService: + return self.v1.subscription_items + + @property + @deprecated( + "stripe_client.subscription_schedules is deprecated. Use stripe_client.v1.subscription_schedules.", + ) + def subscription_schedules(self) -> SubscriptionScheduleService: + return self.v1.subscription_schedules + + @property + @deprecated("stripe_client.tax is deprecated. Use stripe_client.v1.tax.") + def tax(self) -> TaxService: + return self.v1.tax + + @property + @deprecated( + "stripe_client.tax_codes is deprecated. Use stripe_client.v1.tax_codes.", + ) + def tax_codes(self) -> TaxCodeService: + return self.v1.tax_codes + + @property + @deprecated( + "stripe_client.tax_ids is deprecated. Use stripe_client.v1.tax_ids.", + ) + def tax_ids(self) -> TaxIdService: + return self.v1.tax_ids + + @property + @deprecated( + "stripe_client.tax_rates is deprecated. Use stripe_client.v1.tax_rates.", + ) + def tax_rates(self) -> TaxRateService: + return self.v1.tax_rates + + @property + @deprecated( + "stripe_client.terminal is deprecated. Use stripe_client.v1.terminal.", + ) + def terminal(self) -> TerminalService: + return self.v1.terminal + + @property + @deprecated( + "stripe_client.tokens is deprecated. Use stripe_client.v1.tokens." + ) + def tokens(self) -> TokenService: + return self.v1.tokens + + @property + @deprecated( + "stripe_client.topups is deprecated. Use stripe_client.v1.topups." + ) + def topups(self) -> TopupService: + return self.v1.topups + + @property + @deprecated( + "stripe_client.transfers is deprecated. Use stripe_client.v1.transfers.", + ) + def transfers(self) -> TransferService: + return self.v1.transfers + + @property + @deprecated( + "stripe_client.treasury is deprecated. Use stripe_client.v1.treasury.", + ) + def treasury(self) -> TreasuryService: + return self.v1.treasury + + @property + @deprecated( + "stripe_client.webhook_endpoints is deprecated. Use stripe_client.v1.webhook_endpoints.", + ) + def webhook_endpoints(self) -> WebhookEndpointService: + return self.v1.webhook_endpoints + # deprecated v1 services: The end of the section generated from our OpenAPI spec diff --git a/stripe/_v1_services.py b/stripe/_v1_services.py new file mode 100644 index 000000000..929125c90 --- /dev/null +++ b/stripe/_v1_services.py @@ -0,0 +1,160 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._account_link_service import AccountLinkService +from stripe._account_service import AccountService +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_portal_service import BillingPortalService +from stripe._billing_service import BillingService +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._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_link_service import FileLinkService +from stripe._file_service import FileService +from stripe._financial_connections_service import FinancialConnectionsService +from stripe._forwarding_service import ForwardingService +from stripe._identity_service import IdentityService +from stripe._invoice_item_service import InvoiceItemService +from stripe._invoice_payment_service import InvoicePaymentService +from stripe._invoice_rendering_template_service import ( + InvoiceRenderingTemplateService, +) +from stripe._invoice_service import InvoiceService +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_configuration_service import ( + PaymentMethodConfigurationService, +) +from stripe._payment_method_domain_service import PaymentMethodDomainService +from stripe._payment_method_service import PaymentMethodService +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._setup_attempt_service import SetupAttemptService +from stripe._setup_intent_service import SetupIntentService +from stripe._shipping_rate_service import ShippingRateService +from stripe._sigma_service import SigmaService +from stripe._source_service import SourceService +from stripe._stripe_service import StripeService +from stripe._subscription_item_service import SubscriptionItemService +from stripe._subscription_schedule_service import SubscriptionScheduleService +from stripe._subscription_service import SubscriptionService +from stripe._tax_code_service import TaxCodeService +from stripe._tax_id_service import TaxIdService +from stripe._tax_rate_service import TaxRateService +from stripe._tax_service import TaxService +from stripe._terminal_service import TerminalService +from stripe._test_helpers_service import TestHelpersService +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 + + +class V1Services(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + 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_payments = InvoicePaymentService(self._requestor) + self.invoice_rendering_templates = InvoiceRenderingTemplateService( + 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) diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 90094e144..42e192d91 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -10,6 +10,34 @@ class TestGeneratedExamples(object): + def test_account_links_post_service_non_namespaced( + 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", + ) + def test_account_links_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -38,7 +66,7 @@ def test_account_links_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.account_links.create( + client.v1.account_links.create( { "account": "acct_xxxxxxxxxxxxx", "refresh_url": "https://example.com/reauth", @@ -84,7 +112,7 @@ async def test_account_links_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.account_links.create_async( + await client.v1.account_links.create_async( { "account": "acct_xxxxxxxxxxxxx", "refresh_url": "https://example.com/reauth", @@ -100,6 +128,26 @@ async def test_account_links_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_accounts_capabilities_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -122,7 +170,7 @@ def test_accounts_capabilities_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.capabilities.list("acct_xxxxxxxxxxxxx") + client.v1.accounts.capabilities.list("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", @@ -154,7 +202,7 @@ async def test_accounts_capabilities_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.capabilities.list_async("acct_xxxxxxxxxxxxx") + await client.v1.accounts.capabilities.list_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", @@ -162,6 +210,29 @@ async def test_accounts_capabilities_get_service_async( api_base="https://api.stripe.com", ) + def test_accounts_capabilities_get_2_service_non_namespaced( + 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", + ) + def test_accounts_capabilities_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -187,7 +258,7 @@ def test_accounts_capabilities_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.capabilities.retrieve( + client.v1.accounts.capabilities.retrieve( "acct_xxxxxxxxxxxxx", "card_payments", ) @@ -225,7 +296,7 @@ async def test_accounts_capabilities_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.capabilities.retrieve_async( + await client.v1.accounts.capabilities.retrieve_async( "acct_xxxxxxxxxxxxx", "card_payments", ) @@ -236,6 +307,31 @@ async def test_accounts_capabilities_get_2_service_async( api_base="https://api.stripe.com", ) + def test_accounts_capabilities_post_service_non_namespaced( + 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", + ) + def test_accounts_capabilities_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -263,7 +359,7 @@ def test_accounts_capabilities_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.capabilities.update( + client.v1.accounts.capabilities.update( "acct_xxxxxxxxxxxxx", "card_payments", {"requested": True}, @@ -305,7 +401,7 @@ async def test_accounts_capabilities_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.capabilities.update_async( + await client.v1.accounts.capabilities.update_async( "acct_xxxxxxxxxxxxx", "card_payments", {"requested": True}, @@ -318,6 +414,26 @@ async def test_accounts_capabilities_post_service_async( post_data="requested=true", ) + def test_accounts_delete_service_non_namespaced( + 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", + ) + def test_accounts_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.delete("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -338,7 +454,7 @@ def test_accounts_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.delete("acct_xxxxxxxxxxxxx") + client.v1.accounts.delete("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx", @@ -370,7 +486,7 @@ async def test_accounts_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.delete_async("acct_xxxxxxxxxxxxx") + await client.v1.accounts.delete_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx", @@ -378,6 +494,29 @@ async def test_accounts_delete_service_async( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_delete_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -403,7 +542,7 @@ def test_accounts_external_accounts_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.delete( + client.v1.accounts.external_accounts.delete( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -441,7 +580,7 @@ async def test_accounts_external_accounts_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.delete_async( + await client.v1.accounts.external_accounts.delete_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -452,6 +591,29 @@ async def test_accounts_external_accounts_delete_service_async( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_delete_2_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_delete_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -477,7 +639,7 @@ def test_accounts_external_accounts_delete_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.delete( + client.v1.accounts.external_accounts.delete( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -515,7 +677,7 @@ async def test_accounts_external_accounts_delete_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.delete_async( + await client.v1.accounts.external_accounts.delete_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -526,6 +688,30 @@ async def test_accounts_external_accounts_delete_2_service_async( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -552,7 +738,7 @@ def test_accounts_external_accounts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.list( + client.v1.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -591,7 +777,7 @@ async def test_accounts_external_accounts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.list_async( + await client.v1.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -602,6 +788,30 @@ async def test_accounts_external_accounts_get_service_async( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get_2_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -629,7 +839,7 @@ def test_accounts_external_accounts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.list( + client.v1.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) @@ -669,7 +879,7 @@ async def test_accounts_external_accounts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.list_async( + await client.v1.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) @@ -680,6 +890,30 @@ async def test_accounts_external_accounts_get_2_service_async( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get_3_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -707,7 +941,7 @@ def test_accounts_external_accounts_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.list( + client.v1.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) @@ -747,7 +981,7 @@ async def test_accounts_external_accounts_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.list_async( + await client.v1.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) @@ -758,6 +992,29 @@ async def test_accounts_external_accounts_get_3_service_async( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get_4_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -783,7 +1040,7 @@ def test_accounts_external_accounts_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.retrieve( + client.v1.accounts.external_accounts.retrieve( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -821,7 +1078,7 @@ async def test_accounts_external_accounts_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.retrieve_async( + await client.v1.accounts.external_accounts.retrieve_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -832,6 +1089,29 @@ async def test_accounts_external_accounts_get_4_service_async( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_get_5_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_get_5( self, http_client_mock: HTTPClientMock ) -> None: @@ -857,7 +1137,7 @@ def test_accounts_external_accounts_get_5_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.retrieve( + client.v1.accounts.external_accounts.retrieve( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -895,7 +1175,7 @@ async def test_accounts_external_accounts_get_5_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.retrieve_async( + await client.v1.accounts.external_accounts.retrieve_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -906,6 +1186,30 @@ async def test_accounts_external_accounts_get_5_service_async( api_base="https://api.stripe.com", ) + def test_accounts_external_accounts_post_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -932,7 +1236,7 @@ def test_accounts_external_accounts_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.create( + client.v1.accounts.external_accounts.create( "acct_xxxxxxxxxxxxx", {"external_account": "btok_xxxxxxxxxxxxx"}, ) @@ -972,7 +1276,7 @@ async def test_accounts_external_accounts_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.create_async( + await client.v1.accounts.external_accounts.create_async( "acct_xxxxxxxxxxxxx", {"external_account": "btok_xxxxxxxxxxxxx"}, ) @@ -984,6 +1288,30 @@ async def test_accounts_external_accounts_post_service_async( post_data="external_account=btok_xxxxxxxxxxxxx", ) + def test_accounts_external_accounts_post_2_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -1010,7 +1338,7 @@ def test_accounts_external_accounts_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.create( + client.v1.accounts.external_accounts.create( "acct_xxxxxxxxxxxxx", {"external_account": "tok_xxxx_debit"}, ) @@ -1050,7 +1378,7 @@ async def test_accounts_external_accounts_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.create_async( + await client.v1.accounts.external_accounts.create_async( "acct_xxxxxxxxxxxxx", {"external_account": "tok_xxxx_debit"}, ) @@ -1062,6 +1390,31 @@ async def test_accounts_external_accounts_post_2_service_async( post_data="external_account=tok_xxxx_debit", ) + def test_accounts_external_accounts_post_3_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -1089,7 +1442,7 @@ def test_accounts_external_accounts_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.update( + client.v1.accounts.external_accounts.update( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1131,7 +1484,7 @@ async def test_accounts_external_accounts_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.update_async( + await client.v1.accounts.external_accounts.update_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1144,6 +1497,31 @@ async def test_accounts_external_accounts_post_3_service_async( post_data="metadata[order_id]=6735", ) + def test_accounts_external_accounts_post_4_service_non_namespaced( + 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", + ) + def test_accounts_external_accounts_post_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -1171,7 +1549,7 @@ def test_accounts_external_accounts_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.external_accounts.update( + client.v1.accounts.external_accounts.update( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1213,7 +1591,7 @@ async def test_accounts_external_accounts_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.external_accounts.update_async( + await client.v1.accounts.external_accounts.update_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1226,6 +1604,27 @@ async def test_accounts_external_accounts_post_4_service_async( post_data="metadata[order_id]=6735", ) + def test_accounts_get_service_non_namespaced( + 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", + ) + def test_accounts_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.list(limit=3) http_client_mock.assert_requested( @@ -1247,7 +1646,7 @@ def test_accounts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.list({"limit": 3}) + client.v1.accounts.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/accounts", @@ -1280,7 +1679,7 @@ async def test_accounts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.list_async({"limit": 3}) + await client.v1.accounts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/accounts", @@ -1288,6 +1687,26 @@ async def test_accounts_get_service_async( api_base="https://api.stripe.com", ) + def test_accounts_get_2_service_non_namespaced( + 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", + ) + def test_accounts_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.retrieve("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -1308,7 +1727,7 @@ def test_accounts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.retrieve("acct_xxxxxxxxxxxxx") + client.v1.accounts.retrieve("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx", @@ -1340,7 +1759,7 @@ async def test_accounts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.retrieve_async("acct_xxxxxxxxxxxxx") + await client.v1.accounts.retrieve_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx", @@ -1348,6 +1767,26 @@ async def test_accounts_get_2_service_async( api_base="https://api.stripe.com", ) + def test_accounts_login_links_post_service_non_namespaced( + 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", + ) + def test_accounts_login_links_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -1370,7 +1809,7 @@ def test_accounts_login_links_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.login_links.create("acct_xxxxxxxxxxxxx") + client.v1.accounts.login_links.create("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", @@ -1402,7 +1841,7 @@ async def test_accounts_login_links_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.login_links.create_async("acct_xxxxxxxxxxxxx") + await client.v1.accounts.login_links.create_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", @@ -1410,6 +1849,29 @@ async def test_accounts_login_links_post_service_async( api_base="https://api.stripe.com", ) + def test_accounts_persons_delete_service_non_namespaced( + 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", + ) + def test_accounts_persons_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -1435,7 +1897,7 @@ def test_accounts_persons_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.persons.delete( + client.v1.accounts.persons.delete( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) @@ -1473,7 +1935,7 @@ async def test_accounts_persons_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.persons.delete_async( + await client.v1.accounts.persons.delete_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) @@ -1484,6 +1946,30 @@ async def test_accounts_persons_delete_service_async( api_base="https://api.stripe.com", ) + def test_accounts_persons_get_service_non_namespaced( + 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", + ) + def test_accounts_persons_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -1510,7 +1996,7 @@ def test_accounts_persons_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.persons.list( + client.v1.accounts.persons.list( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -1549,7 +2035,7 @@ async def test_accounts_persons_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.persons.list_async( + await client.v1.accounts.persons.list_async( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -1560,6 +2046,29 @@ async def test_accounts_persons_get_service_async( api_base="https://api.stripe.com", ) + def test_accounts_persons_get_2_service_non_namespaced( + 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", + ) + def test_accounts_persons_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -1585,7 +2094,7 @@ def test_accounts_persons_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.persons.retrieve( + client.v1.accounts.persons.retrieve( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) @@ -1623,7 +2132,7 @@ async def test_accounts_persons_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.persons.retrieve_async( + await client.v1.accounts.persons.retrieve_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) @@ -1634,22 +2143,7 @@ async def test_accounts_persons_get_2_service_async( 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( + def test_accounts_persons_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -1673,6 +2167,45 @@ def test_accounts_persons_post_service( post_data="first_name=Jane&last_name=Diaz", ) + 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.v1.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 @@ -1702,7 +2235,7 @@ async def test_accounts_persons_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.persons.create_async( + await client.v1.accounts.persons.create_async( "acct_xxxxxxxxxxxxx", {"first_name": "Jane", "last_name": "Diaz"}, ) @@ -1714,6 +2247,31 @@ async def test_accounts_persons_post_service_async( post_data="first_name=Jane&last_name=Diaz", ) + def test_accounts_persons_post_2_service_non_namespaced( + 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", + ) + def test_accounts_persons_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -1741,7 +2299,7 @@ def test_accounts_persons_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.persons.update( + client.v1.accounts.persons.update( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1783,7 +2341,7 @@ async def test_accounts_persons_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.persons.update_async( + await client.v1.accounts.persons.update_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1796,6 +2354,37 @@ async def test_accounts_persons_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_accounts_post_service_non_namespaced( + 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", + ) + def test_accounts_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.create( type="custom", @@ -1825,7 +2414,7 @@ def test_accounts_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.create( + client.v1.accounts.create( { "type": "custom", "country": "US", @@ -1877,7 +2466,7 @@ async def test_accounts_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.create_async( + await client.v1.accounts.create_async( { "type": "custom", "country": "US", @@ -1896,6 +2485,30 @@ async def test_accounts_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_accounts_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.modify( "acct_xxxxxxxxxxxxx", @@ -1920,7 +2533,7 @@ def test_accounts_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.update( + client.v1.accounts.update( "acct_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -1960,7 +2573,7 @@ async def test_accounts_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.update_async( + await client.v1.accounts.update_async( "acct_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -1972,6 +2585,30 @@ async def test_accounts_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_accounts_reject_post_service_non_namespaced( + 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", + ) + def test_accounts_reject_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -1998,7 +2635,7 @@ def test_accounts_reject_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.accounts.reject( + client.v1.accounts.reject( "acct_xxxxxxxxxxxxx", {"reason": "fraud"}, ) @@ -2038,7 +2675,7 @@ async def test_accounts_reject_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.accounts.reject_async( + await client.v1.accounts.reject_async( "acct_xxxxxxxxxxxxx", {"reason": "fraud"}, ) @@ -2050,6 +2687,27 @@ async def test_accounts_reject_post_service_async( post_data="reason=fraud", ) + def test_application_fees_get_service_non_namespaced( + 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", + ) + def test_application_fees_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -2073,7 +2731,7 @@ def test_application_fees_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.list({"limit": 3}) + client.v1.application_fees.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/application_fees", @@ -2106,7 +2764,7 @@ async def test_application_fees_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.application_fees.list_async({"limit": 3}) + await client.v1.application_fees.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/application_fees", @@ -2114,6 +2772,26 @@ async def test_application_fees_get_service_async( api_base="https://api.stripe.com", ) + def test_application_fees_get_2_service_non_namespaced( + 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", + ) + def test_application_fees_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -2136,7 +2814,7 @@ def test_application_fees_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.retrieve("fee_xxxxxxxxxxxxx") + client.v1.application_fees.retrieve("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx", @@ -2168,7 +2846,7 @@ async def test_application_fees_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.application_fees.retrieve_async("fee_xxxxxxxxxxxxx") + await client.v1.application_fees.retrieve_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx", @@ -2176,6 +2854,30 @@ async def test_application_fees_get_2_service_async( api_base="https://api.stripe.com", ) + def test_application_fees_refunds_get_service_non_namespaced( + 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", + ) + def test_application_fees_refunds_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -2202,7 +2904,7 @@ def test_application_fees_refunds_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.refunds.list( + client.v1.application_fees.refunds.list( "fee_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -2241,7 +2943,7 @@ async def test_application_fees_refunds_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.application_fees.refunds.list_async( + await client.v1.application_fees.refunds.list_async( "fee_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -2252,6 +2954,29 @@ async def test_application_fees_refunds_get_service_async( api_base="https://api.stripe.com", ) + def test_application_fees_refunds_get_2_service_non_namespaced( + 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", + ) + def test_application_fees_refunds_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -2277,7 +3002,7 @@ def test_application_fees_refunds_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.refunds.retrieve( + client.v1.application_fees.refunds.retrieve( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", ) @@ -2315,7 +3040,7 @@ async def test_application_fees_refunds_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.application_fees.refunds.retrieve_async( + await client.v1.application_fees.refunds.retrieve_async( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", ) @@ -2326,6 +3051,26 @@ async def test_application_fees_refunds_get_2_service_async( api_base="https://api.stripe.com", ) + def test_application_fees_refunds_post_service_non_namespaced( + 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", + ) + def test_application_fees_refunds_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -2348,7 +3093,7 @@ def test_application_fees_refunds_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.application_fees.refunds.create("fee_xxxxxxxxxxxxx") + client.v1.application_fees.refunds.create("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", @@ -2380,30 +3125,17 @@ async def test_application_fees_refunds_post_service_async( 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( + await client.v1.application_fees.refunds.create_async( "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx", - metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", - path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", + path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="", - post_data="metadata[order_id]=6735", + api_base="https://api.stripe.com", ) - def test_application_fees_refunds_post_2_service( + def test_application_fees_refunds_post_2_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -2428,6 +3160,46 @@ def test_application_fees_refunds_post_2_service( post_data="metadata[order_id]=6735", ) + 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.v1.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 @@ -2457,7 +3229,7 @@ async def test_application_fees_refunds_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.application_fees.refunds.update_async( + await client.v1.application_fees.refunds.update_async( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -2470,6 +3242,32 @@ async def test_application_fees_refunds_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_apps_secrets_delete_post_service_non_namespaced( + 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", + ) + def test_apps_secrets_delete_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -2496,7 +3294,7 @@ def test_apps_secrets_delete_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.delete_where( + client.v1.apps.secrets.delete_where( { "name": "my-api-key", "scope": {"type": "account"}, @@ -2538,7 +3336,7 @@ async def test_apps_secrets_delete_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.apps.secrets.delete_where_async( + await client.v1.apps.secrets.delete_where_async( { "name": "my-api-key", "scope": {"type": "account"}, @@ -2552,6 +3350,32 @@ async def test_apps_secrets_delete_post_service_async( post_data="name=my-api-key&scope[type]=account", ) + def test_apps_secrets_find_get_service_non_namespaced( + 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", + ) + def test_apps_secrets_find_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -2578,7 +3402,7 @@ def test_apps_secrets_find_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.find( + client.v1.apps.secrets.find( { "name": "sec_123", "scope": {"type": "account"}, @@ -2619,7 +3443,7 @@ async def test_apps_secrets_find_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.apps.secrets.find_async( + await client.v1.apps.secrets.find_async( { "name": "sec_123", "scope": {"type": "account"}, @@ -2632,6 +3456,27 @@ async def test_apps_secrets_find_get_service_async( api_base="https://api.stripe.com", ) + def test_apps_secrets_get_service_non_namespaced( + 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", + ) + def test_apps_secrets_get(self, http_client_mock: HTTPClientMock) -> None: stripe.apps.Secret.list( scope={"type": "account"}, @@ -2656,7 +3501,7 @@ def test_apps_secrets_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) + client.v1.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", @@ -2692,7 +3537,7 @@ async def test_apps_secrets_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.apps.secrets.list_async( + await client.v1.apps.secrets.list_async( { "scope": {"type": "account"}, "limit": 2, @@ -2705,6 +3550,27 @@ async def test_apps_secrets_get_service_async( api_base="https://api.stripe.com", ) + def test_apps_secrets_get_2_service_non_namespaced( + 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", + ) + def test_apps_secrets_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -2731,7 +3597,7 @@ def test_apps_secrets_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) + client.v1.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", @@ -2767,7 +3633,7 @@ async def test_apps_secrets_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.apps.secrets.list_async( + await client.v1.apps.secrets.list_async( { "scope": {"type": "account"}, "limit": 2, @@ -2780,6 +3646,33 @@ async def test_apps_secrets_get_2_service_async( api_base="https://api.stripe.com", ) + def test_apps_secrets_post_service_non_namespaced( + 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", + ) + def test_apps_secrets_post(self, http_client_mock: HTTPClientMock) -> None: stripe.apps.Secret.create( name="sec_123", @@ -2805,7 +3698,7 @@ def test_apps_secrets_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.create( + client.v1.apps.secrets.create( { "name": "sec_123", "payload": "very secret string", @@ -2849,7 +3742,7 @@ async def test_apps_secrets_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.apps.secrets.create_async( + await client.v1.apps.secrets.create_async( { "name": "sec_123", "payload": "very secret string", @@ -2864,6 +3757,33 @@ async def test_apps_secrets_post_service_async( post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) + def test_apps_secrets_post_2_service_non_namespaced( + 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", + ) + def test_apps_secrets_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -2891,7 +3811,7 @@ def test_apps_secrets_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.apps.secrets.create( + client.v1.apps.secrets.create( { "name": "my-api-key", "payload": "secret_key_xxxxxx", @@ -2935,7 +3855,7 @@ async def test_apps_secrets_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.apps.secrets.create_async( + await client.v1.apps.secrets.create_async( { "name": "my-api-key", "payload": "secret_key_xxxxxx", @@ -2950,6 +3870,27 @@ async def test_apps_secrets_post_2_service_async( post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) + def test_balance_transactions_get_service_non_namespaced( + 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", + ) + def test_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -2973,7 +3914,7 @@ def test_balance_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.balance_transactions.list({"limit": 3}) + client.v1.balance_transactions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/balance_transactions", @@ -3006,7 +3947,7 @@ async def test_balance_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.balance_transactions.list_async({"limit": 3}) + await client.v1.balance_transactions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/balance_transactions", @@ -3014,6 +3955,26 @@ async def test_balance_transactions_get_service_async( api_base="https://api.stripe.com", ) + def test_balance_transactions_get_2_service_non_namespaced( + 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", + ) + def test_balance_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -3036,7 +3997,7 @@ def test_balance_transactions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.balance_transactions.retrieve("txn_xxxxxxxxxxxxx") + client.v1.balance_transactions.retrieve("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", @@ -3068,7 +4029,9 @@ async def test_balance_transactions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.balance_transactions.retrieve_async("txn_xxxxxxxxxxxxx") + await client.v1.balance_transactions.retrieve_async( + "txn_xxxxxxxxxxxxx" + ) http_client_mock.assert_requested( "get", path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", @@ -3076,6 +4039,27 @@ async def test_balance_transactions_get_2_service_async( api_base="https://api.stripe.com", ) + def test_billing_portal_configurations_get_service_non_namespaced( + 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", + ) + def test_billing_portal_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -3099,7 +4083,7 @@ def test_billing_portal_configurations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.configurations.list({"limit": 3}) + client.v1.billing_portal.configurations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations", @@ -3132,7 +4116,7 @@ async def test_billing_portal_configurations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.billing_portal.configurations.list_async({"limit": 3}) + await client.v1.billing_portal.configurations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations", @@ -3140,6 +4124,26 @@ async def test_billing_portal_configurations_get_service_async( api_base="https://api.stripe.com", ) + def test_billing_portal_configurations_get_2_service_non_namespaced( + 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", + ) + def test_billing_portal_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -3162,7 +4166,7 @@ def test_billing_portal_configurations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.configurations.retrieve("bpc_xxxxxxxxxxxxx") + client.v1.billing_portal.configurations.retrieve("bpc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", @@ -3196,7 +4200,7 @@ async def test_billing_portal_configurations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.billing_portal.configurations.retrieve_async( + await client.v1.billing_portal.configurations.retrieve_async( "bpc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -3206,6 +4210,41 @@ async def test_billing_portal_configurations_get_2_service_async( api_base="https://api.stripe.com", ) + def test_billing_portal_configurations_post_service_non_namespaced( + 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", + ) + def test_billing_portal_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -3241,7 +4280,7 @@ def test_billing_portal_configurations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.configurations.create( + client.v1.billing_portal.configurations.create( { "features": { "customer_update": { @@ -3301,7 +4340,7 @@ async def test_billing_portal_configurations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.billing_portal.configurations.create_async( + await client.v1.billing_portal.configurations.create_async( { "features": { "customer_update": { @@ -3324,6 +4363,35 @@ async def test_billing_portal_configurations_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_billing_portal_configurations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -3353,7 +4421,7 @@ def test_billing_portal_configurations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.configurations.update( + client.v1.billing_portal.configurations.update( "bpc_xxxxxxxxxxxxx", { "business_profile": { @@ -3401,7 +4469,7 @@ async def test_billing_portal_configurations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.billing_portal.configurations.update_async( + await client.v1.billing_portal.configurations.update_async( "bpc_xxxxxxxxxxxxx", { "business_profile": { @@ -3418,6 +4486,32 @@ async def test_billing_portal_configurations_post_2_service_async( 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_service_non_namespaced( + 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", + ) + def test_billing_portal_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -3444,7 +4538,7 @@ def test_billing_portal_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.billing_portal.sessions.create( + client.v1.billing_portal.sessions.create( { "customer": "cus_xxxxxxxxxxxxx", "return_url": "https://example.com/account", @@ -3486,7 +4580,7 @@ async def test_billing_portal_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.billing_portal.sessions.create_async( + await client.v1.billing_portal.sessions.create_async( { "customer": "cus_xxxxxxxxxxxxx", "return_url": "https://example.com/account", @@ -3500,6 +4594,26 @@ async def test_billing_portal_sessions_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) + def test_charges_capture_post_service_non_namespaced( + 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", + ) + def test_charges_capture_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -3522,7 +4636,7 @@ def test_charges_capture_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.charges.capture("ch_xxxxxxxxxxxxx") + client.v1.charges.capture("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx/capture", @@ -3554,7 +4668,7 @@ async def test_charges_capture_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.charges.capture_async("ch_xxxxxxxxxxxxx") + await client.v1.charges.capture_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx/capture", @@ -3562,6 +4676,27 @@ async def test_charges_capture_post_service_async( api_base="https://api.stripe.com", ) + def test_charges_get_service_non_namespaced( + 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", + ) + def test_charges_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.list(limit=3) http_client_mock.assert_requested( @@ -3583,7 +4718,7 @@ def test_charges_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.charges.list({"limit": 3}) + client.v1.charges.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/charges", @@ -3616,7 +4751,7 @@ async def test_charges_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.charges.list_async({"limit": 3}) + await client.v1.charges.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/charges", @@ -3624,6 +4759,26 @@ async def test_charges_get_service_async( api_base="https://api.stripe.com", ) + def test_charges_get_2_service_non_namespaced( + 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", + ) + def test_charges_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.retrieve("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -3644,7 +4799,7 @@ def test_charges_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.charges.retrieve("ch_xxxxxxxxxxxxx") + client.v1.charges.retrieve("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/charges/ch_xxxxxxxxxxxxx", @@ -3676,7 +4831,7 @@ async def test_charges_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.charges.retrieve_async("ch_xxxxxxxxxxxxx") + await client.v1.charges.retrieve_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/charges/ch_xxxxxxxxxxxxx", @@ -3684,6 +4839,34 @@ async def test_charges_get_2_service_async( api_base="https://api.stripe.com", ) + def test_charges_post_service_non_namespaced( + 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", + ) + def test_charges_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.create( amount=2000, @@ -3710,7 +4893,7 @@ def test_charges_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.charges.create( + client.v1.charges.create( { "amount": 2000, "currency": "usd", @@ -3756,7 +4939,7 @@ async def test_charges_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.charges.create_async( + await client.v1.charges.create_async( { "amount": 2000, "currency": "usd", @@ -3772,6 +4955,30 @@ async def test_charges_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_charges_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.modify( "ch_xxxxxxxxxxxxx", @@ -3796,7 +5003,7 @@ def test_charges_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.charges.update( + client.v1.charges.update( "ch_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -3836,7 +5043,7 @@ async def test_charges_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.charges.update_async( + await client.v1.charges.update_async( "ch_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -3848,6 +5055,31 @@ async def test_charges_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_charges_search_get_service_non_namespaced( + 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", + ) + def test_charges_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -3873,7 +5105,7 @@ def test_charges_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.charges.search( + client.v1.charges.search( { "query": "amount>999 AND metadata['order_id']:'6735'", } @@ -3912,7 +5144,7 @@ async def test_charges_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.charges.search_async( + await client.v1.charges.search_async( { "query": "amount>999 AND metadata['order_id']:'6735'", } @@ -3924,6 +5156,26 @@ async def test_charges_search_get_service_async( api_base="https://api.stripe.com", ) + def test_checkout_sessions_expire_post_service_non_namespaced( + 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", + ) + def test_checkout_sessions_expire_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -3946,7 +5198,7 @@ def test_checkout_sessions_expire_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.expire("sess_xyz") + client.v1.checkout.sessions.expire("sess_xyz") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/sess_xyz/expire", @@ -3978,7 +5230,7 @@ async def test_checkout_sessions_expire_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.checkout.sessions.expire_async("sess_xyz") + await client.v1.checkout.sessions.expire_async("sess_xyz") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/sess_xyz/expire", @@ -3986,6 +5238,26 @@ async def test_checkout_sessions_expire_post_service_async( api_base="https://api.stripe.com", ) + def test_checkout_sessions_expire_post_2_service_non_namespaced( + 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", + ) + def test_checkout_sessions_expire_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -4008,7 +5280,7 @@ def test_checkout_sessions_expire_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.expire("cs_test_xxxxxxxxxxxxx") + client.v1.checkout.sessions.expire("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", @@ -4040,7 +5312,7 @@ async def test_checkout_sessions_expire_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.checkout.sessions.expire_async("cs_test_xxxxxxxxxxxxx") + await client.v1.checkout.sessions.expire_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", @@ -4048,6 +5320,27 @@ async def test_checkout_sessions_expire_post_2_service_async( api_base="https://api.stripe.com", ) + def test_checkout_sessions_get_service_non_namespaced( + 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", + ) + def test_checkout_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -4071,7 +5364,7 @@ def test_checkout_sessions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.list({"limit": 3}) + client.v1.checkout.sessions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions", @@ -4104,7 +5397,7 @@ async def test_checkout_sessions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.checkout.sessions.list_async({"limit": 3}) + await client.v1.checkout.sessions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions", @@ -4112,6 +5405,26 @@ async def test_checkout_sessions_get_service_async( api_base="https://api.stripe.com", ) + def test_checkout_sessions_get_2_service_non_namespaced( + 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", + ) + def test_checkout_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -4134,7 +5447,7 @@ def test_checkout_sessions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.retrieve("cs_test_xxxxxxxxxxxxx") + client.v1.checkout.sessions.retrieve("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", @@ -4166,7 +5479,9 @@ async def test_checkout_sessions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.checkout.sessions.retrieve_async("cs_test_xxxxxxxxxxxxx") + await client.v1.checkout.sessions.retrieve_async( + "cs_test_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", @@ -4174,6 +5489,26 @@ async def test_checkout_sessions_get_2_service_async( api_base="https://api.stripe.com", ) + def test_checkout_sessions_line_items_get_service_non_namespaced( + 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", + ) + def test_checkout_sessions_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -4196,7 +5531,7 @@ def test_checkout_sessions_line_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.line_items.list("sess_xyz") + client.v1.checkout.sessions.line_items.list("sess_xyz") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/sess_xyz/line_items", @@ -4228,7 +5563,7 @@ async def test_checkout_sessions_line_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.checkout.sessions.line_items.list_async("sess_xyz") + await client.v1.checkout.sessions.line_items.list_async("sess_xyz") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/sess_xyz/line_items", @@ -4236,6 +5571,45 @@ async def test_checkout_sessions_line_items_get_service_async( api_base="https://api.stripe.com", ) + def test_checkout_sessions_post_service_non_namespaced( + 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", + ) + def test_checkout_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -4275,7 +5649,7 @@ def test_checkout_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.create( + client.v1.checkout.sessions.create( { "success_url": "https://example.com/success", "cancel_url": "https://example.com/cancel", @@ -4343,7 +5717,7 @@ async def test_checkout_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.checkout.sessions.create_async( + await client.v1.checkout.sessions.create_async( { "success_url": "https://example.com/success", "cancel_url": "https://example.com/cancel", @@ -4370,6 +5744,35 @@ async def test_checkout_sessions_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_checkout_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -4397,7 +5800,7 @@ def test_checkout_sessions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.checkout.sessions.create( + client.v1.checkout.sessions.create( { "success_url": "https://example.com/success", "line_items": [ @@ -4443,7 +5846,7 @@ async def test_checkout_sessions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.checkout.sessions.create_async( + await client.v1.checkout.sessions.create_async( { "success_url": "https://example.com/success", "line_items": [ @@ -4480,6 +5883,27 @@ def test_core_events_get_service( api_base="https://api.stripe.com", ) + def test_country_specs_get_service_non_namespaced( + 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", + ) + def test_country_specs_get(self, http_client_mock: HTTPClientMock) -> None: stripe.CountrySpec.list(limit=3) http_client_mock.assert_requested( @@ -4501,7 +5925,7 @@ def test_country_specs_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.country_specs.list({"limit": 3}) + client.v1.country_specs.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/country_specs", @@ -4534,7 +5958,7 @@ async def test_country_specs_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.country_specs.list_async({"limit": 3}) + await client.v1.country_specs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/country_specs", @@ -4542,6 +5966,26 @@ async def test_country_specs_get_service_async( api_base="https://api.stripe.com", ) + def test_country_specs_get_2_service_non_namespaced( + 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", + ) + def test_country_specs_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -4564,7 +6008,7 @@ def test_country_specs_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.country_specs.retrieve("US") + client.v1.country_specs.retrieve("US") http_client_mock.assert_requested( "get", path="/v1/country_specs/US", @@ -4596,7 +6040,7 @@ async def test_country_specs_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.country_specs.retrieve_async("US") + await client.v1.country_specs.retrieve_async("US") http_client_mock.assert_requested( "get", path="/v1/country_specs/US", @@ -4604,6 +6048,26 @@ async def test_country_specs_get_2_service_async( api_base="https://api.stripe.com", ) + def test_coupons_delete_service_non_namespaced( + 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", + ) + def test_coupons_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.delete("Z4OV52SU") http_client_mock.assert_requested( @@ -4624,7 +6088,7 @@ def test_coupons_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.delete("Z4OV52SU") + client.v1.coupons.delete("Z4OV52SU") http_client_mock.assert_requested( "delete", path="/v1/coupons/Z4OV52SU", @@ -4656,7 +6120,7 @@ async def test_coupons_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.coupons.delete_async("Z4OV52SU") + await client.v1.coupons.delete_async("Z4OV52SU") http_client_mock.assert_requested( "delete", path="/v1/coupons/Z4OV52SU", @@ -4664,6 +6128,27 @@ async def test_coupons_delete_service_async( api_base="https://api.stripe.com", ) + def test_coupons_get_service_non_namespaced( + 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", + ) + def test_coupons_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.list(limit=3) http_client_mock.assert_requested( @@ -4685,7 +6170,7 @@ def test_coupons_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.list({"limit": 3}) + client.v1.coupons.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/coupons", @@ -4718,7 +6203,7 @@ async def test_coupons_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.coupons.list_async({"limit": 3}) + await client.v1.coupons.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/coupons", @@ -4726,6 +6211,26 @@ async def test_coupons_get_service_async( api_base="https://api.stripe.com", ) + def test_coupons_get_2_service_non_namespaced( + 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", + ) + def test_coupons_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.retrieve("Z4OV52SU") http_client_mock.assert_requested( @@ -4746,7 +6251,7 @@ def test_coupons_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.retrieve("Z4OV52SU") + client.v1.coupons.retrieve("Z4OV52SU") http_client_mock.assert_requested( "get", path="/v1/coupons/Z4OV52SU", @@ -4778,7 +6283,7 @@ async def test_coupons_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.coupons.retrieve_async("Z4OV52SU") + await client.v1.coupons.retrieve_async("Z4OV52SU") http_client_mock.assert_requested( "get", path="/v1/coupons/Z4OV52SU", @@ -4786,6 +6291,27 @@ async def test_coupons_get_2_service_async( api_base="https://api.stripe.com", ) + def test_coupons_post_service_non_namespaced( + 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": "once"}) + http_client_mock.assert_requested( + "post", + path="/v1/coupons", + query_string="", + api_base="https://api.stripe.com", + post_data="percent_off=25.5&duration=once", + ) + def test_coupons_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.create( percent_off=25.5, @@ -4810,7 +6336,7 @@ def test_coupons_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.coupons.create({"percent_off": 25.5, "duration": "once"}) + client.v1.coupons.create({"percent_off": 25.5, "duration": "once"}) http_client_mock.assert_requested( "post", path="/v1/coupons", @@ -4847,7 +6373,7 @@ async def test_coupons_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.coupons.create_async( + await client.v1.coupons.create_async( { "percent_off": 25.5, "duration": "once", @@ -4861,19 +6387,7 @@ async def test_coupons_post_service_async( post_data="percent_off=25.5&duration=once", ) - 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( + def test_coupons_post_2_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -4897,6 +6411,42 @@ def test_coupons_post_2_service( post_data="metadata[order_id]=6735", ) + 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.v1.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 @@ -4925,7 +6475,7 @@ async def test_coupons_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.coupons.update_async( + await client.v1.coupons.update_async( "Z4OV52SU", {"metadata": {"order_id": "6735"}}, ) @@ -4937,6 +6487,27 @@ async def test_coupons_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_credit_notes_get_service_non_namespaced( + 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", + ) + def test_credit_notes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.CreditNote.list(limit=3) http_client_mock.assert_requested( @@ -4958,7 +6529,7 @@ def test_credit_notes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.list({"limit": 3}) + client.v1.credit_notes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/credit_notes", @@ -4991,7 +6562,7 @@ async def test_credit_notes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.credit_notes.list_async({"limit": 3}) + await client.v1.credit_notes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/credit_notes", @@ -4999,6 +6570,30 @@ async def test_credit_notes_get_service_async( api_base="https://api.stripe.com", ) + def test_credit_notes_lines_get_service_non_namespaced( + 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", + ) + def test_credit_notes_lines_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -5025,7 +6620,7 @@ def test_credit_notes_lines_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.line_items.list( + client.v1.credit_notes.line_items.list( "cn_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -5064,7 +6659,7 @@ async def test_credit_notes_lines_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.credit_notes.line_items.list_async( + await client.v1.credit_notes.line_items.list_async( "cn_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -5075,6 +6670,38 @@ async def test_credit_notes_lines_get_service_async( api_base="https://api.stripe.com", ) + def test_credit_notes_post_service_non_namespaced( + 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", + ) + def test_credit_notes_post(self, http_client_mock: HTTPClientMock) -> None: stripe.CreditNote.create( invoice="in_xxxxxxxxxxxxx", @@ -5105,7 +6732,7 @@ def test_credit_notes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.create( + client.v1.credit_notes.create( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ @@ -5159,7 +6786,7 @@ async def test_credit_notes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.credit_notes.create_async( + await client.v1.credit_notes.create_async( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ @@ -5179,6 +6806,38 @@ async def test_credit_notes_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_credit_notes_preview_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -5211,7 +6870,7 @@ def test_credit_notes_preview_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.preview( + client.v1.credit_notes.preview( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ @@ -5264,7 +6923,7 @@ async def test_credit_notes_preview_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.credit_notes.preview_async( + await client.v1.credit_notes.preview_async( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ @@ -5283,6 +6942,32 @@ async def test_credit_notes_preview_get_service_async( api_base="https://api.stripe.com", ) + def test_credit_notes_preview_lines_get_service_non_namespaced( + 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", + ) + def test_credit_notes_preview_lines_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -5309,7 +6994,7 @@ def test_credit_notes_preview_lines_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.preview_lines.list( + client.v1.credit_notes.preview_lines.list( { "limit": 3, "invoice": "in_xxxxxxxxxxxxx", @@ -5350,7 +7035,7 @@ async def test_credit_notes_preview_lines_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.credit_notes.preview_lines.list_async( + await client.v1.credit_notes.preview_lines.list_async( { "limit": 3, "invoice": "in_xxxxxxxxxxxxx", @@ -5363,6 +7048,26 @@ async def test_credit_notes_preview_lines_get_service_async( api_base="https://api.stripe.com", ) + def test_credit_notes_void_post_service_non_namespaced( + 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", + ) + def test_credit_notes_void_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -5385,7 +7090,7 @@ def test_credit_notes_void_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.credit_notes.void_credit_note("cn_xxxxxxxxxxxxx") + client.v1.credit_notes.void_credit_note("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", @@ -5417,7 +7122,7 @@ async def test_credit_notes_void_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.credit_notes.void_credit_note_async("cn_xxxxxxxxxxxxx") + await client.v1.credit_notes.void_credit_note_async("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", @@ -5425,6 +7130,32 @@ async def test_credit_notes_void_post_service_async( api_base="https://api.stripe.com", ) + def test_customer_sessions_post_service_non_namespaced( + 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", + ) + def test_customer_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -5451,7 +7182,7 @@ def test_customer_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customer_sessions.create( + client.v1.customer_sessions.create( { "customer": "cus_123", "components": {"buy_button": {"enabled": True}}, @@ -5493,7 +7224,7 @@ async def test_customer_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customer_sessions.create_async( + await client.v1.customer_sessions.create_async( { "customer": "cus_123", "components": {"buy_button": {"enabled": True}}, @@ -5507,6 +7238,30 @@ async def test_customer_sessions_post_service_async( post_data="customer=cus_123&components[buy_button][enabled]=true", ) + def test_customers_balance_transactions_get_service_non_namespaced( + 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", + ) + def test_customers_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -5533,7 +7288,7 @@ def test_customers_balance_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.balance_transactions.list( + client.v1.customers.balance_transactions.list( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -5572,7 +7327,7 @@ async def test_customers_balance_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.balance_transactions.list_async( + await client.v1.customers.balance_transactions.list_async( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -5583,20 +7338,7 @@ async def test_customers_balance_transactions_get_service_async( 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( + def test_customers_balance_transactions_get_2_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -5619,11 +7361,10 @@ def test_customers_balance_transactions_get_2_service( api_base="https://api.stripe.com", ) - @pytest.mark.anyio - async def test_customers_balance_transactions_get_2_async( + def test_customers_balance_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: - await stripe.Customer.retrieve_balance_transaction_async( + stripe.Customer.retrieve_balance_transaction( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", ) @@ -5633,8 +7374,7 @@ async def test_customers_balance_transactions_get_2_async( query_string="", ) - @pytest.mark.anyio - async def test_customers_balance_transactions_get_2_service_async( + def test_customers_balance_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -5646,7 +7386,7 @@ async def test_customers_balance_transactions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.balance_transactions.retrieve_async( + client.v1.customers.balance_transactions.retrieve( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", ) @@ -5657,6 +7397,68 @@ async def test_customers_balance_transactions_get_2_service_async( 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.v1.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_service_non_namespaced( + 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", + ) + def test_customers_balance_transactions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -5684,7 +7486,7 @@ def test_customers_balance_transactions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.balance_transactions.create( + client.v1.customers.balance_transactions.create( "cus_xxxxxxxxxxxxx", {"amount": -500, "currency": "usd"}, ) @@ -5725,7 +7527,7 @@ async def test_customers_balance_transactions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.balance_transactions.create_async( + await client.v1.customers.balance_transactions.create_async( "cus_xxxxxxxxxxxxx", {"amount": -500, "currency": "usd"}, ) @@ -5737,6 +7539,31 @@ async def test_customers_balance_transactions_post_service_async( post_data="amount=-500¤cy=usd", ) + def test_customers_balance_transactions_post_2_service_non_namespaced( + 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", + ) + def test_customers_balance_transactions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -5764,7 +7591,7 @@ def test_customers_balance_transactions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.balance_transactions.update( + client.v1.customers.balance_transactions.update( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -5806,7 +7633,7 @@ async def test_customers_balance_transactions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.balance_transactions.update_async( + await client.v1.customers.balance_transactions.update_async( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -5819,6 +7646,26 @@ async def test_customers_balance_transactions_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_customers_cash_balance_get_service_non_namespaced( + 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", + ) + def test_customers_cash_balance_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -5841,7 +7688,7 @@ def test_customers_cash_balance_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.cash_balance.retrieve("cus_123") + client.v1.customers.cash_balance.retrieve("cus_123") http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance", @@ -5873,7 +7720,7 @@ async def test_customers_cash_balance_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.cash_balance.retrieve_async("cus_123") + await client.v1.customers.cash_balance.retrieve_async("cus_123") http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance", @@ -5881,6 +7728,30 @@ async def test_customers_cash_balance_get_service_async( api_base="https://api.stripe.com", ) + def test_customers_cash_balance_post_service_non_namespaced( + 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", + ) + def test_customers_cash_balance_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -5907,7 +7778,7 @@ def test_customers_cash_balance_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.cash_balance.update( + client.v1.customers.cash_balance.update( "cus_123", {"settings": {"reconciliation_mode": "manual"}}, ) @@ -5947,7 +7818,7 @@ async def test_customers_cash_balance_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.cash_balance.update_async( + await client.v1.customers.cash_balance.update_async( "cus_123", {"settings": {"reconciliation_mode": "manual"}}, ) @@ -5959,6 +7830,30 @@ async def test_customers_cash_balance_post_service_async( post_data="settings[reconciliation_mode]=manual", ) + def test_customers_cash_balance_transactions_get_service_non_namespaced( + 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", + ) + def test_customers_cash_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -5985,7 +7880,7 @@ def test_customers_cash_balance_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.cash_balance_transactions.list( + client.v1.customers.cash_balance_transactions.list( "cus_123", {"limit": 3}, ) @@ -6024,7 +7919,7 @@ async def test_customers_cash_balance_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.cash_balance_transactions.list_async( + await client.v1.customers.cash_balance_transactions.list_async( "cus_123", {"limit": 3}, ) @@ -6035,6 +7930,26 @@ async def test_customers_cash_balance_transactions_get_service_async( api_base="https://api.stripe.com", ) + def test_customers_delete_service_non_namespaced( + 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", + ) + def test_customers_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.delete("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -6055,7 +7970,7 @@ def test_customers_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.delete("cus_xxxxxxxxxxxxx") + client.v1.customers.delete("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", @@ -6087,7 +8002,7 @@ async def test_customers_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.delete_async("cus_xxxxxxxxxxxxx") + await client.v1.customers.delete_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", @@ -6095,6 +8010,37 @@ async def test_customers_delete_service_async( api_base="https://api.stripe.com", ) + def test_customers_funding_instructions_post_service_non_namespaced( + 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", + ) + def test_customers_funding_instructions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -6126,7 +8072,7 @@ def test_customers_funding_instructions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.funding_instructions.create( + client.v1.customers.funding_instructions.create( "cus_123", { "bank_transfer": { @@ -6178,7 +8124,7 @@ async def test_customers_funding_instructions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.funding_instructions.create_async( + await client.v1.customers.funding_instructions.create_async( "cus_123", { "bank_transfer": { @@ -6197,6 +8143,27 @@ async def test_customers_funding_instructions_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_customers_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.list(limit=3) http_client_mock.assert_requested( @@ -6218,7 +8185,7 @@ def test_customers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.list({"limit": 3}) + client.v1.customers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", @@ -6251,7 +8218,28 @@ async def test_customers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.list_async({"limit": 3}) + await client.v1.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_service_non_namespaced( + 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", @@ -6280,7 +8268,7 @@ def test_customers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.list({"limit": 3}) + client.v1.customers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", @@ -6313,7 +8301,7 @@ async def test_customers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.list_async({"limit": 3}) + await client.v1.customers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", @@ -6321,6 +8309,26 @@ async def test_customers_get_2_service_async( api_base="https://api.stripe.com", ) + def test_customers_get_3_service_non_namespaced( + 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", + ) + def test_customers_get_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -6341,7 +8349,7 @@ def test_customers_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.retrieve("cus_xxxxxxxxxxxxx") + client.v1.customers.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", @@ -6373,7 +8381,7 @@ async def test_customers_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.retrieve_async("cus_xxxxxxxxxxxxx") + await client.v1.customers.retrieve_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", @@ -6381,6 +8389,30 @@ async def test_customers_get_3_service_async( api_base="https://api.stripe.com", ) + def test_customers_payment_methods_get_service_non_namespaced( + 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", + ) + def test_customers_payment_methods_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -6407,7 +8439,7 @@ def test_customers_payment_methods_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_methods.list( + client.v1.customers.payment_methods.list( "cus_xyz", {"type": "card"}, ) @@ -6446,7 +8478,7 @@ async def test_customers_payment_methods_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_methods.list_async( + await client.v1.customers.payment_methods.list_async( "cus_xyz", {"type": "card"}, ) @@ -6457,6 +8489,30 @@ async def test_customers_payment_methods_get_service_async( api_base="https://api.stripe.com", ) + def test_customers_payment_methods_get_2_service_non_namespaced( + 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", + ) + def test_customers_payment_methods_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -6483,7 +8539,7 @@ def test_customers_payment_methods_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_methods.list( + client.v1.customers.payment_methods.list( "cus_xxxxxxxxxxxxx", {"type": "card"}, ) @@ -6522,7 +8578,7 @@ async def test_customers_payment_methods_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_methods.list_async( + await client.v1.customers.payment_methods.list_async( "cus_xxxxxxxxxxxxx", {"type": "card"}, ) @@ -6533,6 +8589,31 @@ async def test_customers_payment_methods_get_2_service_async( api_base="https://api.stripe.com", ) + def test_customers_post_service_non_namespaced( + 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", + ) + 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)", @@ -6556,7 +8637,7 @@ def test_customers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.create( + client.v1.customers.create( { "description": "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", } @@ -6596,7 +8677,7 @@ async def test_customers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.create_async( + await client.v1.customers.create_async( { "description": "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", } @@ -6609,6 +8690,30 @@ async def test_customers_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_customers_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.modify( "cus_xxxxxxxxxxxxx", @@ -6633,7 +8738,7 @@ def test_customers_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.update( + client.v1.customers.update( "cus_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -6673,7 +8778,7 @@ async def test_customers_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.update_async( + await client.v1.customers.update_async( "cus_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -6685,6 +8790,31 @@ async def test_customers_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_customers_search_get_service_non_namespaced( + 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", + ) + def test_customers_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -6710,7 +8840,7 @@ def test_customers_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.search( + client.v1.customers.search( { "query": "name:'fakename' AND metadata['foo']:'bar'", } @@ -6749,7 +8879,32 @@ async def test_customers_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.search_async( + await client.v1.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_service_non_namespaced( + 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'", } @@ -6786,7 +8941,7 @@ def test_customers_search_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.search( + client.v1.customers.search( { "query": "name:'fakename' AND metadata['foo']:'bar'", } @@ -6825,7 +8980,7 @@ async def test_customers_search_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.search_async( + await client.v1.customers.search_async( { "query": "name:'fakename' AND metadata['foo']:'bar'", } @@ -6837,6 +8992,29 @@ async def test_customers_search_get_2_service_async( api_base="https://api.stripe.com", ) + def test_customers_sources_delete_service_non_namespaced( + 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", + ) + def test_customers_sources_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -6862,7 +9040,7 @@ def test_customers_sources_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.sources.detach( + client.v1.sources.detach( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -6900,7 +9078,7 @@ async def test_customers_sources_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.sources.detach_async( + await client.v1.sources.detach_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -6911,6 +9089,29 @@ async def test_customers_sources_delete_service_async( api_base="https://api.stripe.com", ) + def test_customers_sources_delete_2_service_non_namespaced( + 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", + ) + def test_customers_sources_delete_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -6936,7 +9137,7 @@ def test_customers_sources_delete_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.sources.detach( + client.v1.sources.detach( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -6974,7 +9175,7 @@ async def test_customers_sources_delete_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.sources.detach_async( + await client.v1.sources.detach_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -6985,6 +9186,30 @@ async def test_customers_sources_delete_2_service_async( api_base="https://api.stripe.com", ) + def test_customers_sources_get_service_non_namespaced( + 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", + ) + def test_customers_sources_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -7012,7 +9237,7 @@ def test_customers_sources_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.list( + client.v1.customers.payment_sources.list( "cus_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) @@ -7052,7 +9277,7 @@ async def test_customers_sources_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_sources.list_async( + await client.v1.customers.payment_sources.list_async( "cus_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) @@ -7063,6 +9288,30 @@ async def test_customers_sources_get_service_async( api_base="https://api.stripe.com", ) + def test_customers_sources_get_2_service_non_namespaced( + 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", + ) + def test_customers_sources_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -7090,7 +9339,7 @@ def test_customers_sources_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.list( + client.v1.customers.payment_sources.list( "cus_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) @@ -7130,7 +9379,7 @@ async def test_customers_sources_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_sources.list_async( + await client.v1.customers.payment_sources.list_async( "cus_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) @@ -7141,20 +9390,7 @@ async def test_customers_sources_get_2_service_async( 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( + def test_customers_sources_get_3_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -7177,11 +9413,10 @@ def test_customers_sources_get_3_service( api_base="https://api.stripe.com", ) - @pytest.mark.anyio - async def test_customers_sources_get_3_async( + def test_customers_sources_get_3( self, http_client_mock: HTTPClientMock ) -> None: - await stripe.Customer.retrieve_source_async( + stripe.Customer.retrieve_source( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -7191,8 +9426,7 @@ async def test_customers_sources_get_3_async( query_string="", ) - @pytest.mark.anyio - async def test_customers_sources_get_3_service_async( + def test_customers_sources_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -7204,7 +9438,7 @@ async def test_customers_sources_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_sources.retrieve_async( + client.v1.customers.payment_sources.retrieve( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -7215,6 +9449,67 @@ async def test_customers_sources_get_3_service_async( 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.v1.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_service_non_namespaced( + 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", + ) + def test_customers_sources_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -7240,7 +9535,7 @@ def test_customers_sources_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.retrieve( + client.v1.customers.payment_sources.retrieve( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -7278,7 +9573,7 @@ async def test_customers_sources_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_sources.retrieve_async( + await client.v1.customers.payment_sources.retrieve_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -7289,6 +9584,31 @@ async def test_customers_sources_get_4_service_async( api_base="https://api.stripe.com", ) + def test_customers_sources_post_service_non_namespaced( + 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", + ) + def test_customers_sources_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -7316,7 +9636,7 @@ def test_customers_sources_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.update( + client.v1.customers.payment_sources.update( "cus_123", "card_123", {"account_holder_name": "Kamil"}, @@ -7358,7 +9678,7 @@ async def test_customers_sources_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_sources.update_async( + await client.v1.customers.payment_sources.update_async( "cus_123", "card_123", {"account_holder_name": "Kamil"}, @@ -7371,6 +9691,30 @@ async def test_customers_sources_post_service_async( post_data="account_holder_name=Kamil", ) + def test_customers_sources_post_2_service_non_namespaced( + 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", + ) + def test_customers_sources_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -7397,7 +9741,7 @@ def test_customers_sources_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.create( + client.v1.customers.payment_sources.create( "cus_xxxxxxxxxxxxx", {"source": "btok_xxxxxxxxxxxxx"}, ) @@ -7437,7 +9781,7 @@ async def test_customers_sources_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_sources.create_async( + await client.v1.customers.payment_sources.create_async( "cus_xxxxxxxxxxxxx", {"source": "btok_xxxxxxxxxxxxx"}, ) @@ -7449,6 +9793,30 @@ async def test_customers_sources_post_2_service_async( post_data="source=btok_xxxxxxxxxxxxx", ) + def test_customers_sources_post_3_service_non_namespaced( + 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", + ) + def test_customers_sources_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -7475,7 +9843,7 @@ def test_customers_sources_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.create( + client.v1.customers.payment_sources.create( "cus_xxxxxxxxxxxxx", {"source": "tok_xxxx"}, ) @@ -7515,7 +9883,7 @@ async def test_customers_sources_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_sources.create_async( + await client.v1.customers.payment_sources.create_async( "cus_xxxxxxxxxxxxx", {"source": "tok_xxxx"}, ) @@ -7527,6 +9895,31 @@ async def test_customers_sources_post_3_service_async( post_data="source=tok_xxxx", ) + def test_customers_sources_post_4_service_non_namespaced( + 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", + ) + def test_customers_sources_post_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -7554,7 +9947,7 @@ def test_customers_sources_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.update( + client.v1.customers.payment_sources.update( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -7596,7 +9989,7 @@ async def test_customers_sources_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_sources.update_async( + await client.v1.customers.payment_sources.update_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -7609,6 +10002,31 @@ async def test_customers_sources_post_4_service_async( post_data="metadata[order_id]=6735", ) + def test_customers_sources_post_5_service_non_namespaced( + 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", + ) + def test_customers_sources_post_5( self, http_client_mock: HTTPClientMock ) -> None: @@ -7636,7 +10054,7 @@ def test_customers_sources_post_5_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.payment_sources.update( + client.v1.customers.payment_sources.update( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"name": "Jenny Rosen"}, @@ -7678,7 +10096,7 @@ async def test_customers_sources_post_5_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.payment_sources.update_async( + await client.v1.customers.payment_sources.update_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"name": "Jenny Rosen"}, @@ -7691,6 +10109,29 @@ async def test_customers_sources_post_5_service_async( post_data="name=Jenny%20Rosen", ) + def test_customers_tax_ids_delete_service_non_namespaced( + 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", + ) + def test_customers_tax_ids_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -7716,7 +10157,7 @@ def test_customers_tax_ids_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.tax_ids.delete( + client.v1.customers.tax_ids.delete( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) @@ -7754,7 +10195,7 @@ async def test_customers_tax_ids_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.tax_ids.delete_async( + await client.v1.customers.tax_ids.delete_async( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) @@ -7765,6 +10206,30 @@ async def test_customers_tax_ids_delete_service_async( api_base="https://api.stripe.com", ) + def test_customers_tax_ids_get_service_non_namespaced( + 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", + ) + def test_customers_tax_ids_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -7791,7 +10256,7 @@ def test_customers_tax_ids_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.tax_ids.list( + client.v1.customers.tax_ids.list( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -7830,7 +10295,7 @@ async def test_customers_tax_ids_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.tax_ids.list_async( + await client.v1.customers.tax_ids.list_async( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -7841,6 +10306,29 @@ async def test_customers_tax_ids_get_service_async( api_base="https://api.stripe.com", ) + def test_customers_tax_ids_get_2_service_non_namespaced( + 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", + ) + def test_customers_tax_ids_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -7866,7 +10354,7 @@ def test_customers_tax_ids_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.customers.tax_ids.retrieve( + client.v1.customers.tax_ids.retrieve( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) @@ -7904,7 +10392,7 @@ async def test_customers_tax_ids_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.tax_ids.retrieve_async( + await client.v1.customers.tax_ids.retrieve_async( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) @@ -7915,22 +10403,7 @@ async def test_customers_tax_ids_get_2_service_async( 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( + def test_customers_tax_ids_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -7954,6 +10427,45 @@ def test_customers_tax_ids_post_service( post_data="type=eu_vat&value=DE123456789", ) + 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.v1.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 @@ -7983,7 +10495,7 @@ async def test_customers_tax_ids_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.customers.tax_ids.create_async( + await client.v1.customers.tax_ids.create_async( "cus_xxxxxxxxxxxxx", {"type": "eu_vat", "value": "DE123456789"}, ) @@ -7995,6 +10507,26 @@ async def test_customers_tax_ids_post_service_async( post_data="type=eu_vat&value=DE123456789", ) + def test_disputes_close_post_service_non_namespaced( + 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", + ) + def test_disputes_close_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -8017,7 +10549,7 @@ def test_disputes_close_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.disputes.close("dp_xxxxxxxxxxxxx") + client.v1.disputes.close("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx/close", @@ -8049,7 +10581,7 @@ async def test_disputes_close_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.disputes.close_async("dp_xxxxxxxxxxxxx") + await client.v1.disputes.close_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx/close", @@ -8057,6 +10589,27 @@ async def test_disputes_close_post_service_async( api_base="https://api.stripe.com", ) + def test_disputes_get_service_non_namespaced( + 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", + ) + def test_disputes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Dispute.list(limit=3) http_client_mock.assert_requested( @@ -8078,7 +10631,7 @@ def test_disputes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.disputes.list({"limit": 3}) + client.v1.disputes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/disputes", @@ -8111,7 +10664,7 @@ async def test_disputes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.disputes.list_async({"limit": 3}) + await client.v1.disputes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/disputes", @@ -8119,6 +10672,26 @@ async def test_disputes_get_service_async( api_base="https://api.stripe.com", ) + def test_disputes_get_2_service_non_namespaced( + 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", + ) + def test_disputes_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Dispute.retrieve("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -8139,7 +10712,7 @@ def test_disputes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.disputes.retrieve("dp_xxxxxxxxxxxxx") + client.v1.disputes.retrieve("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/disputes/dp_xxxxxxxxxxxxx", @@ -8171,7 +10744,7 @@ async def test_disputes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.disputes.retrieve_async("dp_xxxxxxxxxxxxx") + await client.v1.disputes.retrieve_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/disputes/dp_xxxxxxxxxxxxx", @@ -8179,6 +10752,30 @@ async def test_disputes_get_2_service_async( api_base="https://api.stripe.com", ) + def test_disputes_post_service_non_namespaced( + 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", + ) + def test_disputes_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Dispute.modify( "dp_xxxxxxxxxxxxx", @@ -8203,7 +10800,7 @@ def test_disputes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.disputes.update( + client.v1.disputes.update( "dp_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -8243,7 +10840,7 @@ async def test_disputes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.disputes.update_async( + await client.v1.disputes.update_async( "dp_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -8255,6 +10852,27 @@ async def test_disputes_post_service_async( post_data="metadata[order_id]=6735", ) + def test_events_get_service_non_namespaced( + 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", + ) + def test_events_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Event.list(limit=3) http_client_mock.assert_requested( @@ -8276,7 +10894,7 @@ def test_events_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.events.list({"limit": 3}) + client.v1.events.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/events", @@ -8309,7 +10927,7 @@ async def test_events_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.events.list_async({"limit": 3}) + await client.v1.events.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/events", @@ -8317,6 +10935,26 @@ async def test_events_get_service_async( api_base="https://api.stripe.com", ) + def test_events_get_2_service_non_namespaced( + 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", + ) + def test_events_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Event.retrieve("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -8337,7 +10975,7 @@ def test_events_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.events.retrieve("evt_xxxxxxxxxxxxx") + client.v1.events.retrieve("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/events/evt_xxxxxxxxxxxxx", @@ -8369,7 +11007,7 @@ async def test_events_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.events.retrieve_async("evt_xxxxxxxxxxxxx") + await client.v1.events.retrieve_async("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/events/evt_xxxxxxxxxxxxx", @@ -8377,6 +11015,27 @@ async def test_events_get_2_service_async( api_base="https://api.stripe.com", ) + def test_file_links_get_service_non_namespaced( + 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", + ) + def test_file_links_get(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.list(limit=3) http_client_mock.assert_requested( @@ -8398,7 +11057,7 @@ def test_file_links_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.file_links.list({"limit": 3}) + client.v1.file_links.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/file_links", @@ -8431,7 +11090,7 @@ async def test_file_links_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.file_links.list_async({"limit": 3}) + await client.v1.file_links.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/file_links", @@ -8439,6 +11098,26 @@ async def test_file_links_get_service_async( api_base="https://api.stripe.com", ) + def test_file_links_get_2_service_non_namespaced( + 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", + ) + def test_file_links_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.retrieve("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -8459,7 +11138,7 @@ def test_file_links_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.file_links.retrieve("link_xxxxxxxxxxxxx") + client.v1.file_links.retrieve("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/file_links/link_xxxxxxxxxxxxx", @@ -8491,7 +11170,7 @@ async def test_file_links_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.file_links.retrieve_async("link_xxxxxxxxxxxxx") + await client.v1.file_links.retrieve_async("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/file_links/link_xxxxxxxxxxxxx", @@ -8499,6 +11178,27 @@ async def test_file_links_get_2_service_async( api_base="https://api.stripe.com", ) + def test_file_links_post_service_non_namespaced( + 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", + ) + def test_file_links_post(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.create(file="file_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -8520,7 +11220,7 @@ def test_file_links_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.file_links.create({"file": "file_xxxxxxxxxxxxx"}) + client.v1.file_links.create({"file": "file_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/file_links", @@ -8554,7 +11254,7 @@ async def test_file_links_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.file_links.create_async({"file": "file_xxxxxxxxxxxxx"}) + await client.v1.file_links.create_async({"file": "file_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/file_links", @@ -8563,6 +11263,30 @@ async def test_file_links_post_service_async( post_data="file=file_xxxxxxxxxxxxx", ) + def test_file_links_post_2_service_non_namespaced( + 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", + ) + def test_file_links_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.modify( "link_xxxxxxxxxxxxx", @@ -8587,7 +11311,7 @@ def test_file_links_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.file_links.update( + client.v1.file_links.update( "link_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -8627,7 +11351,7 @@ async def test_file_links_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.file_links.update_async( + await client.v1.file_links.update_async( "link_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -8639,6 +11363,27 @@ async def test_file_links_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_files_get_service_non_namespaced( + 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", + ) + def test_files_get(self, http_client_mock: HTTPClientMock) -> None: stripe.File.list(limit=3) http_client_mock.assert_requested( @@ -8658,7 +11403,7 @@ def test_files_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client=http_client_mock.get_mock_http_client(), ) - client.files.list({"limit": 3}) + client.v1.files.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/files", @@ -8691,7 +11436,7 @@ async def test_files_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.files.list_async({"limit": 3}) + await client.v1.files.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/files", @@ -8699,6 +11444,26 @@ async def test_files_get_service_async( api_base="https://api.stripe.com", ) + def test_files_get_2_service_non_namespaced( + 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", + ) + def test_files_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.File.retrieve("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -8719,7 +11484,7 @@ def test_files_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.files.retrieve("file_xxxxxxxxxxxxx") + client.v1.files.retrieve("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/files/file_xxxxxxxxxxxxx", @@ -8751,7 +11516,7 @@ async def test_files_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.files.retrieve_async("file_xxxxxxxxxxxxx") + await client.v1.files.retrieve_async("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/files/file_xxxxxxxxxxxxx", @@ -8759,6 +11524,31 @@ async def test_files_get_2_service_async( api_base="https://api.stripe.com", ) + def test_files_post_service_non_namespaced( + 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", + ) + def test_files_post(self, http_client_mock: HTTPClientMock) -> None: stripe.File.create( purpose="account_requirement", @@ -8782,7 +11572,7 @@ def test_files_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.files.create( + client.v1.files.create( { "purpose": "account_requirement", "file": io.StringIO("foo"), @@ -8822,7 +11612,7 @@ async def test_files_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.files.create_async( + await client.v1.files.create_async( { "purpose": "account_requirement", "file": io.StringIO("foo"), @@ -8835,6 +11625,26 @@ async def test_files_post_service_async( api_base="https://files.stripe.com", ) + def test_financial_connections_accounts_disconnect_post_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_disconnect_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -8857,7 +11667,7 @@ def test_financial_connections_accounts_disconnect_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.disconnect("fca_xyz") + client.v1.financial_connections.accounts.disconnect("fca_xyz") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/disconnect", @@ -8889,7 +11699,9 @@ async def test_financial_connections_accounts_disconnect_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.disconnect_async("fca_xyz") + await client.v1.financial_connections.accounts.disconnect_async( + "fca_xyz", + ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/disconnect", @@ -8897,6 +11709,26 @@ async def test_financial_connections_accounts_disconnect_post_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_disconnect_post_2_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_disconnect_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -8919,7 +11751,9 @@ def test_financial_connections_accounts_disconnect_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.disconnect("fca_xxxxxxxxxxxxx") + client.v1.financial_connections.accounts.disconnect( + "fca_xxxxxxxxxxxxx" + ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", @@ -8953,7 +11787,7 @@ async def test_financial_connections_accounts_disconnect_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.disconnect_async( + await client.v1.financial_connections.accounts.disconnect_async( "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -8963,6 +11797,26 @@ async def test_financial_connections_accounts_disconnect_post_2_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_get_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -8985,7 +11839,7 @@ def test_financial_connections_accounts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.list() + client.v1.financial_connections.accounts.list() http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", @@ -9017,7 +11871,7 @@ async def test_financial_connections_accounts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.list_async() + await client.v1.financial_connections.accounts.list_async() http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", @@ -9025,6 +11879,26 @@ async def test_financial_connections_accounts_get_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_get_2_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -9047,7 +11921,7 @@ def test_financial_connections_accounts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.retrieve("fca_xyz") + client.v1.financial_connections.accounts.retrieve("fca_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz", @@ -9079,7 +11953,9 @@ async def test_financial_connections_accounts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.retrieve_async("fca_xyz") + await client.v1.financial_connections.accounts.retrieve_async( + "fca_xyz" + ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz", @@ -9087,6 +11963,31 @@ async def test_financial_connections_accounts_get_2_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_get_3_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -9112,7 +12013,7 @@ def test_financial_connections_accounts_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.list( + client.v1.financial_connections.accounts.list( { "account_holder": {"customer": "cus_xxxxxxxxxxxxx"}, } @@ -9151,7 +12052,7 @@ async def test_financial_connections_accounts_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.list_async( + await client.v1.financial_connections.accounts.list_async( { "account_holder": {"customer": "cus_xxxxxxxxxxxxx"}, } @@ -9163,6 +12064,26 @@ async def test_financial_connections_accounts_get_3_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_get_4_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -9185,7 +12106,7 @@ def test_financial_connections_accounts_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.retrieve("fca_xxxxxxxxxxxxx") + client.v1.financial_connections.accounts.retrieve("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", @@ -9219,7 +12140,7 @@ async def test_financial_connections_accounts_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.retrieve_async( + await client.v1.financial_connections.accounts.retrieve_async( "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -9229,6 +12150,30 @@ async def test_financial_connections_accounts_get_4_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_owners_get_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_owners_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -9255,7 +12200,7 @@ def test_financial_connections_accounts_owners_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.owners.list( + client.v1.financial_connections.accounts.owners.list( "fca_xyz", {"ownership": "fcaowns_xyz"}, ) @@ -9294,7 +12239,7 @@ async def test_financial_connections_accounts_owners_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.owners.list_async( + await client.v1.financial_connections.accounts.owners.list_async( "fca_xyz", {"ownership": "fcaowns_xyz"}, ) @@ -9305,6 +12250,30 @@ async def test_financial_connections_accounts_owners_get_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_owners_get_2_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_owners_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -9332,7 +12301,7 @@ def test_financial_connections_accounts_owners_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.owners.list( + client.v1.financial_connections.accounts.owners.list( "fca_xxxxxxxxxxxxx", {"limit": 3, "ownership": "fcaowns_xxxxxxxxxxxxx"}, ) @@ -9372,7 +12341,7 @@ async def test_financial_connections_accounts_owners_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.owners.list_async( + await client.v1.financial_connections.accounts.owners.list_async( "fca_xxxxxxxxxxxxx", {"limit": 3, "ownership": "fcaowns_xxxxxxxxxxxxx"}, ) @@ -9383,6 +12352,30 @@ async def test_financial_connections_accounts_owners_get_2_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_accounts_refresh_post_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_refresh_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -9409,7 +12402,7 @@ def test_financial_connections_accounts_refresh_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.refresh( + client.v1.financial_connections.accounts.refresh( "fca_xyz", {"features": ["balance"]}, ) @@ -9449,7 +12442,7 @@ async def test_financial_connections_accounts_refresh_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.refresh_async( + await client.v1.financial_connections.accounts.refresh_async( "fca_xyz", {"features": ["balance"]}, ) @@ -9461,21 +12454,7 @@ async def test_financial_connections_accounts_refresh_post_service_async( 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( + def test_financial_connections_accounts_subscribe_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -9499,6 +12478,44 @@ def test_financial_connections_accounts_subscribe_post_service( post_data="features[0]=transactions", ) + 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.v1.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 @@ -9527,7 +12544,7 @@ async def test_financial_connections_accounts_subscribe_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.subscribe_async( + await client.v1.financial_connections.accounts.subscribe_async( "fa_123", {"features": ["transactions"]}, ) @@ -9539,6 +12556,30 @@ async def test_financial_connections_accounts_subscribe_post_service_async( post_data="features[0]=transactions", ) + def test_financial_connections_accounts_unsubscribe_post_service_non_namespaced( + 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", + ) + def test_financial_connections_accounts_unsubscribe_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -9565,7 +12606,7 @@ def test_financial_connections_accounts_unsubscribe_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.accounts.unsubscribe( + client.v1.financial_connections.accounts.unsubscribe( "fa_123", {"features": ["transactions"]}, ) @@ -9605,7 +12646,7 @@ async def test_financial_connections_accounts_unsubscribe_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.accounts.unsubscribe_async( + await client.v1.financial_connections.accounts.unsubscribe_async( "fa_123", {"features": ["transactions"]}, ) @@ -9617,6 +12658,26 @@ async def test_financial_connections_accounts_unsubscribe_post_service_async( post_data="features[0]=transactions", ) + def test_financial_connections_sessions_get_service_non_namespaced( + 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", + ) + def test_financial_connections_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -9639,7 +12700,7 @@ def test_financial_connections_sessions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.sessions.retrieve("fcsess_xyz") + client.v1.financial_connections.sessions.retrieve("fcsess_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xyz", @@ -9671,8 +12732,8 @@ async def test_financial_connections_sessions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.sessions.retrieve_async( - "fcsess_xyz" + await client.v1.financial_connections.sessions.retrieve_async( + "fcsess_xyz", ) http_client_mock.assert_requested( "get", @@ -9681,6 +12742,26 @@ async def test_financial_connections_sessions_get_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_sessions_get_2_service_non_namespaced( + 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", + ) + def test_financial_connections_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -9703,7 +12784,9 @@ def test_financial_connections_sessions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.sessions.retrieve("fcsess_xxxxxxxxxxxxx") + client.v1.financial_connections.sessions.retrieve( + "fcsess_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", @@ -9737,7 +12820,7 @@ async def test_financial_connections_sessions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.sessions.retrieve_async( + await client.v1.financial_connections.sessions.retrieve_async( "fcsess_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -9747,6 +12830,32 @@ async def test_financial_connections_sessions_get_2_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_sessions_post_service_non_namespaced( + 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", + ) + def test_financial_connections_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -9773,7 +12882,7 @@ def test_financial_connections_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.sessions.create( + client.v1.financial_connections.sessions.create( { "account_holder": {"type": "customer", "customer": "cus_123"}, "permissions": ["balances"], @@ -9815,7 +12924,7 @@ async def test_financial_connections_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.sessions.create_async( + await client.v1.financial_connections.sessions.create_async( { "account_holder": {"type": "customer", "customer": "cus_123"}, "permissions": ["balances"], @@ -9829,6 +12938,36 @@ async def test_financial_connections_sessions_post_service_async( post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) + def test_financial_connections_sessions_post_2_service_non_namespaced( + 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", + ) + def test_financial_connections_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -9859,7 +12998,7 @@ def test_financial_connections_sessions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.sessions.create( + client.v1.financial_connections.sessions.create( { "account_holder": { "type": "customer", @@ -9909,7 +13048,7 @@ async def test_financial_connections_sessions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.sessions.create_async( + await client.v1.financial_connections.sessions.create_async( { "account_holder": { "type": "customer", @@ -9927,6 +13066,26 @@ async def test_financial_connections_sessions_post_2_service_async( 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_service_non_namespaced( + 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", + ) + def test_financial_connections_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -9949,7 +13108,7 @@ def test_financial_connections_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.transactions.retrieve("tr_123") + client.v1.financial_connections.transactions.retrieve("tr_123") http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions/tr_123", @@ -9981,8 +13140,8 @@ async def test_financial_connections_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.transactions.retrieve_async( - "tr_123" + await client.v1.financial_connections.transactions.retrieve_async( + "tr_123", ) http_client_mock.assert_requested( "get", @@ -9991,6 +13150,27 @@ async def test_financial_connections_transactions_get_service_async( api_base="https://api.stripe.com", ) + def test_financial_connections_transactions_get_2_service_non_namespaced( + 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", + ) + def test_financial_connections_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -10014,7 +13194,11 @@ def test_financial_connections_transactions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.financial_connections.transactions.list({"account": "fca_xyz"}) + client.v1.financial_connections.transactions.list( + { + "account": "fca_xyz", + } + ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions", @@ -10049,7 +13233,7 @@ async def test_financial_connections_transactions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.financial_connections.transactions.list_async( + await client.v1.financial_connections.transactions.list_async( { "account": "fca_xyz", } @@ -10061,6 +13245,27 @@ async def test_financial_connections_transactions_get_2_service_async( api_base="https://api.stripe.com", ) + def test_identity_verification_reports_get_service_non_namespaced( + 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", + ) + def test_identity_verification_reports_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -10084,7 +13289,7 @@ def test_identity_verification_reports_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_reports.list({"limit": 3}) + client.v1.identity.verification_reports.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports", @@ -10117,7 +13322,7 @@ async def test_identity_verification_reports_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.identity.verification_reports.list_async({"limit": 3}) + await client.v1.identity.verification_reports.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports", @@ -10125,6 +13330,26 @@ async def test_identity_verification_reports_get_service_async( api_base="https://api.stripe.com", ) + def test_identity_verification_reports_get_2_service_non_namespaced( + 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", + ) + def test_identity_verification_reports_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -10147,7 +13372,7 @@ def test_identity_verification_reports_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_reports.retrieve("vr_xxxxxxxxxxxxx") + client.v1.identity.verification_reports.retrieve("vr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", @@ -10181,7 +13406,7 @@ async def test_identity_verification_reports_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.identity.verification_reports.retrieve_async( + await client.v1.identity.verification_reports.retrieve_async( "vr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -10191,6 +13416,26 @@ async def test_identity_verification_reports_get_2_service_async( api_base="https://api.stripe.com", ) + def test_identity_verification_sessions_cancel_post_service_non_namespaced( + 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", + ) + def test_identity_verification_sessions_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -10213,7 +13458,7 @@ def test_identity_verification_sessions_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.cancel("vs_xxxxxxxxxxxxx") + client.v1.identity.verification_sessions.cancel("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", @@ -10247,7 +13492,7 @@ async def test_identity_verification_sessions_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.identity.verification_sessions.cancel_async( + await client.v1.identity.verification_sessions.cancel_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -10257,6 +13502,27 @@ async def test_identity_verification_sessions_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_identity_verification_sessions_get_service_non_namespaced( + 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", + ) + def test_identity_verification_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -10280,7 +13546,7 @@ def test_identity_verification_sessions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.list({"limit": 3}) + client.v1.identity.verification_sessions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions", @@ -10313,7 +13579,7 @@ async def test_identity_verification_sessions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.identity.verification_sessions.list_async({"limit": 3}) + await client.v1.identity.verification_sessions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions", @@ -10321,6 +13587,26 @@ async def test_identity_verification_sessions_get_service_async( api_base="https://api.stripe.com", ) + def test_identity_verification_sessions_get_2_service_non_namespaced( + 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", + ) + def test_identity_verification_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -10343,7 +13629,7 @@ def test_identity_verification_sessions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.retrieve("vs_xxxxxxxxxxxxx") + client.v1.identity.verification_sessions.retrieve("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", @@ -10377,7 +13663,7 @@ async def test_identity_verification_sessions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.identity.verification_sessions.retrieve_async( + await client.v1.identity.verification_sessions.retrieve_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -10387,6 +13673,27 @@ async def test_identity_verification_sessions_get_2_service_async( api_base="https://api.stripe.com", ) + def test_identity_verification_sessions_post_service_non_namespaced( + 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", + ) + def test_identity_verification_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -10410,7 +13717,7 @@ def test_identity_verification_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.create({"type": "document"}) + client.v1.identity.verification_sessions.create({"type": "document"}) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions", @@ -10444,7 +13751,7 @@ async def test_identity_verification_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.identity.verification_sessions.create_async( + await client.v1.identity.verification_sessions.create_async( { "type": "document", } @@ -10457,6 +13764,30 @@ async def test_identity_verification_sessions_post_service_async( post_data="type=document", ) + def test_identity_verification_sessions_post_2_service_non_namespaced( + 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", + ) + def test_identity_verification_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -10483,7 +13814,7 @@ def test_identity_verification_sessions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.update( + client.v1.identity.verification_sessions.update( "vs_xxxxxxxxxxxxx", {"type": "id_number"}, ) @@ -10523,7 +13854,7 @@ async def test_identity_verification_sessions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.identity.verification_sessions.update_async( + await client.v1.identity.verification_sessions.update_async( "vs_xxxxxxxxxxxxx", {"type": "id_number"}, ) @@ -10535,6 +13866,26 @@ async def test_identity_verification_sessions_post_2_service_async( post_data="type=id_number", ) + def test_identity_verification_sessions_redact_post_service_non_namespaced( + 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", + ) + def test_identity_verification_sessions_redact_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -10557,7 +13908,7 @@ def test_identity_verification_sessions_redact_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.identity.verification_sessions.redact("vs_xxxxxxxxxxxxx") + client.v1.identity.verification_sessions.redact("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", @@ -10591,7 +13942,7 @@ async def test_identity_verification_sessions_redact_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.identity.verification_sessions.redact_async( + await client.v1.identity.verification_sessions.redact_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -10601,6 +13952,26 @@ async def test_identity_verification_sessions_redact_post_service_async( api_base="https://api.stripe.com", ) + def test_invoiceitems_delete_service_non_namespaced( + 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", + ) + def test_invoiceitems_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -10623,7 +13994,7 @@ def test_invoiceitems_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.delete("ii_xxxxxxxxxxxxx") + client.v1.invoice_items.delete("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", @@ -10655,7 +14026,7 @@ async def test_invoiceitems_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoice_items.delete_async("ii_xxxxxxxxxxxxx") + await client.v1.invoice_items.delete_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", @@ -10663,6 +14034,27 @@ async def test_invoiceitems_delete_service_async( api_base="https://api.stripe.com", ) + def test_invoiceitems_get_service_non_namespaced( + 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", + ) + def test_invoiceitems_get(self, http_client_mock: HTTPClientMock) -> None: stripe.InvoiceItem.list(limit=3) http_client_mock.assert_requested( @@ -10684,7 +14076,7 @@ def test_invoiceitems_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.list({"limit": 3}) + client.v1.invoice_items.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoiceitems", @@ -10717,7 +14109,7 @@ async def test_invoiceitems_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoice_items.list_async({"limit": 3}) + await client.v1.invoice_items.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoiceitems", @@ -10725,6 +14117,26 @@ async def test_invoiceitems_get_service_async( api_base="https://api.stripe.com", ) + def test_invoiceitems_get_2_service_non_namespaced( + 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", + ) + def test_invoiceitems_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -10747,7 +14159,7 @@ def test_invoiceitems_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.retrieve("ii_xxxxxxxxxxxxx") + client.v1.invoice_items.retrieve("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", @@ -10779,7 +14191,7 @@ async def test_invoiceitems_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoice_items.retrieve_async("ii_xxxxxxxxxxxxx") + await client.v1.invoice_items.retrieve_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", @@ -10787,6 +14199,27 @@ async def test_invoiceitems_get_2_service_async( api_base="https://api.stripe.com", ) + def test_invoiceitems_post_service_non_namespaced( + 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"}) + http_client_mock.assert_requested( + "post", + path="/v1/invoiceitems", + query_string="", + api_base="https://api.stripe.com", + post_data="customer=cus_xxxxxxxxxxxxx", + ) + def test_invoiceitems_post(self, http_client_mock: HTTPClientMock) -> None: stripe.InvoiceItem.create(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -10808,7 +14241,7 @@ def test_invoiceitems_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.create({"customer": "cus_xxxxxxxxxxxxx"}) + client.v1.invoice_items.create({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/invoiceitems", @@ -10842,7 +14275,7 @@ async def test_invoiceitems_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoice_items.create_async( + await client.v1.invoice_items.create_async( { "customer": "cus_xxxxxxxxxxxxx", } @@ -10855,6 +14288,30 @@ async def test_invoiceitems_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx", ) + def test_invoiceitems_post_2_service_non_namespaced( + 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", + ) + def test_invoiceitems_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -10881,7 +14338,7 @@ def test_invoiceitems_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoice_items.update( + client.v1.invoice_items.update( "ii_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -10921,7 +14378,7 @@ async def test_invoiceitems_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoice_items.update_async( + await client.v1.invoice_items.update_async( "ii_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -10933,6 +14390,26 @@ async def test_invoiceitems_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_invoices_delete_service_non_namespaced( + 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", + ) + def test_invoices_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.delete("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -10953,7 +14430,7 @@ def test_invoices_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.delete("in_xxxxxxxxxxxxx") + client.v1.invoices.delete("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoices/in_xxxxxxxxxxxxx", @@ -10985,7 +14462,7 @@ async def test_invoices_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.delete_async("in_xxxxxxxxxxxxx") + await client.v1.invoices.delete_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoices/in_xxxxxxxxxxxxx", @@ -10993,6 +14470,26 @@ async def test_invoices_delete_service_async( api_base="https://api.stripe.com", ) + def test_invoices_finalize_post_service_non_namespaced( + 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", + ) + def test_invoices_finalize_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -11015,7 +14512,7 @@ def test_invoices_finalize_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.finalize_invoice("in_xxxxxxxxxxxxx") + client.v1.invoices.finalize_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", @@ -11047,7 +14544,7 @@ async def test_invoices_finalize_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.finalize_invoice_async("in_xxxxxxxxxxxxx") + await client.v1.invoices.finalize_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", @@ -11055,6 +14552,27 @@ async def test_invoices_finalize_post_service_async( api_base="https://api.stripe.com", ) + def test_invoices_get_service_non_namespaced( + 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", + ) + def test_invoices_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.list(limit=3) http_client_mock.assert_requested( @@ -11076,7 +14594,7 @@ def test_invoices_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.list({"limit": 3}) + client.v1.invoices.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoices", @@ -11109,7 +14627,7 @@ async def test_invoices_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.list_async({"limit": 3}) + await client.v1.invoices.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoices", @@ -11117,6 +14635,26 @@ async def test_invoices_get_service_async( api_base="https://api.stripe.com", ) + def test_invoices_get_2_service_non_namespaced( + 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", + ) + def test_invoices_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.retrieve("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -11137,7 +14675,7 @@ def test_invoices_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.retrieve("in_xxxxxxxxxxxxx") + client.v1.invoices.retrieve("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", @@ -11169,7 +14707,7 @@ async def test_invoices_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.retrieve_async("in_xxxxxxxxxxxxx") + await client.v1.invoices.retrieve_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", @@ -11177,6 +14715,30 @@ async def test_invoices_get_2_service_async( api_base="https://api.stripe.com", ) + def test_invoices_get_3_service_non_namespaced( + 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", + ) + def test_invoices_get_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.retrieve( "in_xxxxxxxxxxxxx", @@ -11201,7 +14763,7 @@ def test_invoices_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.retrieve( + client.v1.invoices.retrieve( "in_xxxxxxxxxxxxx", {"expand": ["customer"]}, ) @@ -11240,7 +14802,7 @@ async def test_invoices_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.retrieve_async( + await client.v1.invoices.retrieve_async( "in_xxxxxxxxxxxxx", {"expand": ["customer"]}, ) @@ -11251,6 +14813,26 @@ async def test_invoices_get_3_service_async( api_base="https://api.stripe.com", ) + def test_invoices_mark_uncollectible_post_service_non_namespaced( + 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", + ) + def test_invoices_mark_uncollectible_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -11273,7 +14855,7 @@ def test_invoices_mark_uncollectible_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.mark_uncollectible("in_xxxxxxxxxxxxx") + client.v1.invoices.mark_uncollectible("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", @@ -11305,7 +14887,7 @@ async def test_invoices_mark_uncollectible_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.mark_uncollectible_async("in_xxxxxxxxxxxxx") + await client.v1.invoices.mark_uncollectible_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", @@ -11313,6 +14895,26 @@ async def test_invoices_mark_uncollectible_post_service_async( api_base="https://api.stripe.com", ) + def test_invoices_pay_post_service_non_namespaced( + 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", + ) + def test_invoices_pay_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.pay("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -11333,7 +14935,7 @@ def test_invoices_pay_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.pay("in_xxxxxxxxxxxxx") + client.v1.invoices.pay("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/pay", @@ -11365,7 +14967,7 @@ async def test_invoices_pay_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.pay_async("in_xxxxxxxxxxxxx") + await client.v1.invoices.pay_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/pay", @@ -11373,6 +14975,27 @@ async def test_invoices_pay_post_service_async( api_base="https://api.stripe.com", ) + def test_invoices_post_service_non_namespaced( + 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", + ) + def test_invoices_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.create(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -11394,7 +15017,7 @@ def test_invoices_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.create({"customer": "cus_xxxxxxxxxxxxx"}) + client.v1.invoices.create({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/invoices", @@ -11428,7 +15051,9 @@ async def test_invoices_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.create_async({"customer": "cus_xxxxxxxxxxxxx"}) + await client.v1.invoices.create_async( + {"customer": "cus_xxxxxxxxxxxxx"} + ) http_client_mock.assert_requested( "post", path="/v1/invoices", @@ -11437,6 +15062,30 @@ async def test_invoices_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx", ) + def test_invoices_post_2_service_non_namespaced( + 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", + ) + def test_invoices_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.modify( "in_xxxxxxxxxxxxx", @@ -11461,7 +15110,7 @@ def test_invoices_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.update( + client.v1.invoices.update( "in_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -11501,7 +15150,7 @@ async def test_invoices_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.update_async( + await client.v1.invoices.update_async( "in_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -11513,6 +15162,31 @@ async def test_invoices_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_invoices_search_get_service_non_namespaced( + 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", + ) + def test_invoices_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -11538,7 +15212,7 @@ def test_invoices_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.search( + client.v1.invoices.search( { "query": "total>999 AND metadata['order_id']:'6735'", } @@ -11577,7 +15251,7 @@ async def test_invoices_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.search_async( + await client.v1.invoices.search_async( { "query": "total>999 AND metadata['order_id']:'6735'", } @@ -11589,6 +15263,26 @@ async def test_invoices_search_get_service_async( api_base="https://api.stripe.com", ) + def test_invoices_send_post_service_non_namespaced( + 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", + ) + def test_invoices_send_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -11611,7 +15305,7 @@ def test_invoices_send_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.send_invoice("in_xxxxxxxxxxxxx") + client.v1.invoices.send_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/send", @@ -11643,7 +15337,7 @@ async def test_invoices_send_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.send_invoice_async("in_xxxxxxxxxxxxx") + await client.v1.invoices.send_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/send", @@ -11651,6 +15345,26 @@ async def test_invoices_send_post_service_async( api_base="https://api.stripe.com", ) + def test_invoices_void_post_service_non_namespaced( + 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", + ) + def test_invoices_void_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -11673,7 +15387,7 @@ def test_invoices_void_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.invoices.void_invoice("in_xxxxxxxxxxxxx") + client.v1.invoices.void_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/void", @@ -11705,7 +15419,7 @@ async def test_invoices_void_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.invoices.void_invoice_async("in_xxxxxxxxxxxxx") + await client.v1.invoices.void_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/void", @@ -11713,6 +15427,26 @@ async def test_invoices_void_post_service_async( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_approve_post_service_non_namespaced( + 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", + ) + def test_issuing_authorizations_approve_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -11735,7 +15469,7 @@ def test_issuing_authorizations_approve_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.approve("iauth_xxxxxxxxxxxxx") + client.v1.issuing.authorizations.approve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", @@ -11767,8 +15501,8 @@ async def test_issuing_authorizations_approve_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.authorizations.approve_async( - "iauth_xxxxxxxxxxxxx" + await client.v1.issuing.authorizations.approve_async( + "iauth_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", @@ -11777,6 +15511,26 @@ async def test_issuing_authorizations_approve_post_service_async( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_decline_post_service_non_namespaced( + 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", + ) + def test_issuing_authorizations_decline_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -11799,7 +15553,7 @@ def test_issuing_authorizations_decline_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.decline("iauth_xxxxxxxxxxxxx") + client.v1.issuing.authorizations.decline("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", @@ -11831,8 +15585,8 @@ async def test_issuing_authorizations_decline_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.authorizations.decline_async( - "iauth_xxxxxxxxxxxxx" + await client.v1.issuing.authorizations.decline_async( + "iauth_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", @@ -11841,6 +15595,27 @@ async def test_issuing_authorizations_decline_post_service_async( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_get_service_non_namespaced( + 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", + ) + def test_issuing_authorizations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -11864,7 +15639,7 @@ def test_issuing_authorizations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.list({"limit": 3}) + client.v1.issuing.authorizations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations", @@ -11897,7 +15672,7 @@ async def test_issuing_authorizations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.authorizations.list_async({"limit": 3}) + await client.v1.issuing.authorizations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations", @@ -11905,6 +15680,26 @@ async def test_issuing_authorizations_get_service_async( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_get_2_service_non_namespaced( + 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", + ) + def test_issuing_authorizations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -11927,7 +15722,7 @@ def test_issuing_authorizations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.retrieve("iauth_xxxxxxxxxxxxx") + client.v1.issuing.authorizations.retrieve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", @@ -11961,7 +15756,7 @@ async def test_issuing_authorizations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.authorizations.retrieve_async( + await client.v1.issuing.authorizations.retrieve_async( "iauth_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -11971,6 +15766,30 @@ async def test_issuing_authorizations_get_2_service_async( api_base="https://api.stripe.com", ) + def test_issuing_authorizations_post_service_non_namespaced( + 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", + ) + def test_issuing_authorizations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -11997,7 +15816,7 @@ def test_issuing_authorizations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.authorizations.update( + client.v1.issuing.authorizations.update( "iauth_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -12037,7 +15856,7 @@ async def test_issuing_authorizations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.authorizations.update_async( + await client.v1.issuing.authorizations.update_async( "iauth_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -12049,6 +15868,27 @@ async def test_issuing_authorizations_post_service_async( post_data="metadata[order_id]=6735", ) + def test_issuing_cardholders_get_service_non_namespaced( + 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", + ) + def test_issuing_cardholders_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -12072,7 +15912,7 @@ def test_issuing_cardholders_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cardholders.list({"limit": 3}) + client.v1.issuing.cardholders.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders", @@ -12105,7 +15945,7 @@ async def test_issuing_cardholders_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.cardholders.list_async({"limit": 3}) + await client.v1.issuing.cardholders.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders", @@ -12113,6 +15953,26 @@ async def test_issuing_cardholders_get_service_async( api_base="https://api.stripe.com", ) + def test_issuing_cardholders_get_2_service_non_namespaced( + 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", + ) + def test_issuing_cardholders_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -12135,7 +15995,7 @@ def test_issuing_cardholders_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cardholders.retrieve("ich_xxxxxxxxxxxxx") + client.v1.issuing.cardholders.retrieve("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", @@ -12167,7 +16027,7 @@ async def test_issuing_cardholders_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.cardholders.retrieve_async("ich_xxxxxxxxxxxxx") + await client.v1.issuing.cardholders.retrieve_async("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", @@ -12175,6 +16035,43 @@ async def test_issuing_cardholders_get_2_service_async( api_base="https://api.stripe.com", ) + def test_issuing_cardholders_post_service_non_namespaced( + 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", + ) + def test_issuing_cardholders_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -12212,7 +16109,7 @@ def test_issuing_cardholders_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cardholders.create( + client.v1.issuing.cardholders.create( { "type": "individual", "name": "Jenny Rosen", @@ -12276,7 +16173,7 @@ async def test_issuing_cardholders_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.cardholders.create_async( + await client.v1.issuing.cardholders.create_async( { "type": "individual", "name": "Jenny Rosen", @@ -12301,6 +16198,30 @@ async def test_issuing_cardholders_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_issuing_cardholders_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -12327,7 +16248,7 @@ def test_issuing_cardholders_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cardholders.update( + client.v1.issuing.cardholders.update( "ich_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -12367,7 +16288,7 @@ async def test_issuing_cardholders_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.cardholders.update_async( + await client.v1.issuing.cardholders.update_async( "ich_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -12379,6 +16300,27 @@ async def test_issuing_cardholders_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_issuing_cards_get_service_non_namespaced( + 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", + ) + def test_issuing_cards_get(self, http_client_mock: HTTPClientMock) -> None: stripe.issuing.Card.list(limit=3) http_client_mock.assert_requested( @@ -12400,7 +16342,7 @@ def test_issuing_cards_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cards.list({"limit": 3}) + client.v1.issuing.cards.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cards", @@ -12433,7 +16375,7 @@ async def test_issuing_cards_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.cards.list_async({"limit": 3}) + await client.v1.issuing.cards.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cards", @@ -12441,6 +16383,26 @@ async def test_issuing_cards_get_service_async( api_base="https://api.stripe.com", ) + def test_issuing_cards_get_2_service_non_namespaced( + 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", + ) + def test_issuing_cards_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -12463,7 +16425,7 @@ def test_issuing_cards_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cards.retrieve("ic_xxxxxxxxxxxxx") + client.v1.issuing.cards.retrieve("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", @@ -12495,7 +16457,7 @@ async def test_issuing_cards_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.cards.retrieve_async("ic_xxxxxxxxxxxxx") + await client.v1.issuing.cards.retrieve_async("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", @@ -12503,6 +16465,33 @@ async def test_issuing_cards_get_2_service_async( api_base="https://api.stripe.com", ) + def test_issuing_cards_post_service_non_namespaced( + 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", + ) + def test_issuing_cards_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -12530,7 +16519,7 @@ def test_issuing_cards_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cards.create( + client.v1.issuing.cards.create( { "cardholder": "ich_xxxxxxxxxxxxx", "currency": "usd", @@ -12574,7 +16563,7 @@ async def test_issuing_cards_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.cards.create_async( + await client.v1.issuing.cards.create_async( { "cardholder": "ich_xxxxxxxxxxxxx", "currency": "usd", @@ -12589,6 +16578,30 @@ async def test_issuing_cards_post_service_async( post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) + def test_issuing_cards_post_2_service_non_namespaced( + 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", + ) + def test_issuing_cards_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -12615,7 +16628,7 @@ def test_issuing_cards_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.cards.update( + client.v1.issuing.cards.update( "ic_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -12655,7 +16668,7 @@ async def test_issuing_cards_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.cards.update_async( + await client.v1.issuing.cards.update_async( "ic_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -12667,6 +16680,27 @@ async def test_issuing_cards_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_issuing_disputes_get_service_non_namespaced( + 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", + ) + def test_issuing_disputes_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -12690,7 +16724,7 @@ def test_issuing_disputes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.disputes.list({"limit": 3}) + client.v1.issuing.disputes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/disputes", @@ -12723,7 +16757,7 @@ async def test_issuing_disputes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.disputes.list_async({"limit": 3}) + await client.v1.issuing.disputes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/disputes", @@ -12731,6 +16765,26 @@ async def test_issuing_disputes_get_service_async( api_base="https://api.stripe.com", ) + def test_issuing_disputes_get_2_service_non_namespaced( + 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", + ) + def test_issuing_disputes_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -12753,7 +16807,7 @@ def test_issuing_disputes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.disputes.retrieve("idp_xxxxxxxxxxxxx") + client.v1.issuing.disputes.retrieve("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", @@ -12785,7 +16839,7 @@ async def test_issuing_disputes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.disputes.retrieve_async("idp_xxxxxxxxxxxxx") + await client.v1.issuing.disputes.retrieve_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", @@ -12793,6 +16847,37 @@ async def test_issuing_disputes_get_2_service_async( api_base="https://api.stripe.com", ) + def test_issuing_disputes_post_service_non_namespaced( + 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.", + ) + def test_issuing_disputes_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -12822,7 +16907,7 @@ def test_issuing_disputes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.disputes.create( + client.v1.issuing.disputes.create( { "transaction": "ipi_xxxxxxxxxxxxx", "evidence": { @@ -12872,7 +16957,7 @@ async def test_issuing_disputes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.disputes.create_async( + await client.v1.issuing.disputes.create_async( { "transaction": "ipi_xxxxxxxxxxxxx", "evidence": { @@ -12891,6 +16976,26 @@ async def test_issuing_disputes_post_service_async( post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) + def test_issuing_disputes_submit_post_service_non_namespaced( + 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", + ) + def test_issuing_disputes_submit_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -12913,7 +17018,7 @@ def test_issuing_disputes_submit_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.disputes.submit("idp_xxxxxxxxxxxxx") + client.v1.issuing.disputes.submit("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", @@ -12945,7 +17050,7 @@ async def test_issuing_disputes_submit_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.disputes.submit_async("idp_xxxxxxxxxxxxx") + await client.v1.issuing.disputes.submit_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", @@ -12953,6 +17058,26 @@ async def test_issuing_disputes_submit_post_service_async( api_base="https://api.stripe.com", ) + def test_issuing_personalization_designs_get_service_non_namespaced( + 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", + ) + def test_issuing_personalization_designs_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -12975,7 +17100,7 @@ def test_issuing_personalization_designs_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.personalization_designs.list() + client.v1.issuing.personalization_designs.list() http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs", @@ -13007,7 +17132,7 @@ async def test_issuing_personalization_designs_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.personalization_designs.list_async() + await client.v1.issuing.personalization_designs.list_async() http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs", @@ -13015,6 +17140,26 @@ async def test_issuing_personalization_designs_get_service_async( api_base="https://api.stripe.com", ) + def test_issuing_personalization_designs_get_2_service_non_namespaced( + 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", + ) + def test_issuing_personalization_designs_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -13037,7 +17182,7 @@ def test_issuing_personalization_designs_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.personalization_designs.retrieve("pd_xyz") + client.v1.issuing.personalization_designs.retrieve("pd_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs/pd_xyz", @@ -13069,7 +17214,9 @@ async def test_issuing_personalization_designs_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.personalization_designs.retrieve_async("pd_xyz") + await client.v1.issuing.personalization_designs.retrieve_async( + "pd_xyz" + ) http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs/pd_xyz", @@ -13077,6 +17224,31 @@ async def test_issuing_personalization_designs_get_2_service_async( api_base="https://api.stripe.com", ) + def test_issuing_personalization_designs_post_service_non_namespaced( + 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", + ) + def test_issuing_personalization_designs_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -13100,7 +17272,7 @@ def test_issuing_personalization_designs_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.personalization_designs.create( + client.v1.issuing.personalization_designs.create( { "physical_bundle": "pb_xyz", } @@ -13140,7 +17312,7 @@ async def test_issuing_personalization_designs_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.personalization_designs.create_async( + await client.v1.issuing.personalization_designs.create_async( { "physical_bundle": "pb_xyz", } @@ -13153,6 +17325,26 @@ async def test_issuing_personalization_designs_post_service_async( post_data="physical_bundle=pb_xyz", ) + def test_issuing_personalization_designs_post_2_service_non_namespaced( + 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", + ) + def test_issuing_personalization_designs_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -13175,7 +17367,7 @@ def test_issuing_personalization_designs_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.personalization_designs.update("pd_xyz") + client.v1.issuing.personalization_designs.update("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs/pd_xyz", @@ -13207,7 +17399,7 @@ async def test_issuing_personalization_designs_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.personalization_designs.update_async("pd_xyz") + await client.v1.issuing.personalization_designs.update_async("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs/pd_xyz", @@ -13215,6 +17407,26 @@ async def test_issuing_personalization_designs_post_2_service_async( api_base="https://api.stripe.com", ) + def test_issuing_physical_bundles_get_service_non_namespaced( + 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", + ) + def test_issuing_physical_bundles_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -13237,7 +17449,7 @@ def test_issuing_physical_bundles_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.physical_bundles.list() + client.v1.issuing.physical_bundles.list() http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles", @@ -13269,7 +17481,7 @@ async def test_issuing_physical_bundles_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.physical_bundles.list_async() + await client.v1.issuing.physical_bundles.list_async() http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles", @@ -13277,6 +17489,26 @@ async def test_issuing_physical_bundles_get_service_async( api_base="https://api.stripe.com", ) + def test_issuing_physical_bundles_get_2_service_non_namespaced( + 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", + ) + def test_issuing_physical_bundles_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -13299,7 +17531,7 @@ def test_issuing_physical_bundles_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.physical_bundles.retrieve("pb_xyz") + client.v1.issuing.physical_bundles.retrieve("pb_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles/pb_xyz", @@ -13331,7 +17563,7 @@ async def test_issuing_physical_bundles_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.physical_bundles.retrieve_async("pb_xyz") + await client.v1.issuing.physical_bundles.retrieve_async("pb_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles/pb_xyz", @@ -13339,6 +17571,27 @@ async def test_issuing_physical_bundles_get_2_service_async( api_base="https://api.stripe.com", ) + def test_issuing_transactions_get_service_non_namespaced( + 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", + ) + def test_issuing_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -13362,7 +17615,7 @@ def test_issuing_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.transactions.list({"limit": 3}) + client.v1.issuing.transactions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions", @@ -13395,7 +17648,7 @@ async def test_issuing_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.transactions.list_async({"limit": 3}) + await client.v1.issuing.transactions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions", @@ -13403,6 +17656,26 @@ async def test_issuing_transactions_get_service_async( api_base="https://api.stripe.com", ) + def test_issuing_transactions_get_2_service_non_namespaced( + 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", + ) + def test_issuing_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -13425,7 +17698,7 @@ def test_issuing_transactions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.issuing.transactions.retrieve("ipi_xxxxxxxxxxxxx") + client.v1.issuing.transactions.retrieve("ipi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", @@ -13457,7 +17730,9 @@ async def test_issuing_transactions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.transactions.retrieve_async("ipi_xxxxxxxxxxxxx") + await client.v1.issuing.transactions.retrieve_async( + "ipi_xxxxxxxxxxxxx" + ) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", @@ -13465,21 +17740,7 @@ async def test_issuing_transactions_get_2_service_async( 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( + def test_issuing_transactions_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -13503,11 +17764,10 @@ def test_issuing_transactions_post_service( post_data="metadata[order_id]=6735", ) - @pytest.mark.anyio - async def test_issuing_transactions_post_async( + def test_issuing_transactions_post( self, http_client_mock: HTTPClientMock ) -> None: - await stripe.issuing.Transaction.modify_async( + stripe.issuing.Transaction.modify( "ipi_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) @@ -13518,8 +17778,7 @@ async def test_issuing_transactions_post_async( post_data="metadata[order_id]=6735", ) - @pytest.mark.anyio - async def test_issuing_transactions_post_service_async( + def test_issuing_transactions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -13531,7 +17790,7 @@ async def test_issuing_transactions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.issuing.transactions.update_async( + client.v1.issuing.transactions.update( "ipi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -13543,6 +17802,66 @@ async def test_issuing_transactions_post_service_async( 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.v1.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_service_non_namespaced( + 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", + ) + def test_mandates_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Mandate.retrieve("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -13563,7 +17882,7 @@ def test_mandates_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.mandates.retrieve("mandate_xxxxxxxxxxxxx") + client.v1.mandates.retrieve("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/mandates/mandate_xxxxxxxxxxxxx", @@ -13595,7 +17914,7 @@ async def test_mandates_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.mandates.retrieve_async("mandate_xxxxxxxxxxxxx") + await client.v1.mandates.retrieve_async("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/mandates/mandate_xxxxxxxxxxxxx", @@ -13603,6 +17922,26 @@ async def test_mandates_get_service_async( api_base="https://api.stripe.com", ) + def test_payment_intents_apply_customer_balance_post_service_non_namespaced( + 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", + ) + def test_payment_intents_apply_customer_balance_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -13625,7 +17964,7 @@ def test_payment_intents_apply_customer_balance_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.apply_customer_balance("pi_xxxxxxxxxxxxx") + client.v1.payment_intents.apply_customer_balance("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", @@ -13659,7 +17998,7 @@ async def test_payment_intents_apply_customer_balance_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.apply_customer_balance_async( + await client.v1.payment_intents.apply_customer_balance_async( "pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -13669,6 +18008,26 @@ async def test_payment_intents_apply_customer_balance_post_service_async( api_base="https://api.stripe.com", ) + def test_payment_intents_cancel_post_service_non_namespaced( + 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", + ) + def test_payment_intents_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -13691,7 +18050,7 @@ def test_payment_intents_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.cancel("pi_xxxxxxxxxxxxx") + client.v1.payment_intents.cancel("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", @@ -13723,7 +18082,7 @@ async def test_payment_intents_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.cancel_async("pi_xxxxxxxxxxxxx") + await client.v1.payment_intents.cancel_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", @@ -13731,6 +18090,26 @@ async def test_payment_intents_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_payment_intents_capture_post_service_non_namespaced( + 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", + ) + def test_payment_intents_capture_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -13753,7 +18132,7 @@ def test_payment_intents_capture_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.capture("pi_xxxxxxxxxxxxx") + client.v1.payment_intents.capture("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", @@ -13785,7 +18164,7 @@ async def test_payment_intents_capture_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.capture_async("pi_xxxxxxxxxxxxx") + await client.v1.payment_intents.capture_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", @@ -13793,6 +18172,30 @@ async def test_payment_intents_capture_post_service_async( api_base="https://api.stripe.com", ) + def test_payment_intents_confirm_post_service_non_namespaced( + 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", + ) + def test_payment_intents_confirm_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -13819,7 +18222,7 @@ def test_payment_intents_confirm_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.confirm( + client.v1.payment_intents.confirm( "pi_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) @@ -13859,7 +18262,7 @@ async def test_payment_intents_confirm_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.confirm_async( + await client.v1.payment_intents.confirm_async( "pi_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) @@ -13871,6 +18274,27 @@ async def test_payment_intents_confirm_post_service_async( post_data="payment_method=pm_card_visa", ) + def test_payment_intents_get_service_non_namespaced( + 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", + ) + def test_payment_intents_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -13894,7 +18318,7 @@ def test_payment_intents_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.list({"limit": 3}) + client.v1.payment_intents.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_intents", @@ -13927,7 +18351,7 @@ async def test_payment_intents_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.list_async({"limit": 3}) + await client.v1.payment_intents.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_intents", @@ -13935,6 +18359,26 @@ async def test_payment_intents_get_service_async( api_base="https://api.stripe.com", ) + def test_payment_intents_get_2_service_non_namespaced( + 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", + ) + def test_payment_intents_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -13957,7 +18401,7 @@ def test_payment_intents_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.retrieve("pi_xxxxxxxxxxxxx") + client.v1.payment_intents.retrieve("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", @@ -13989,7 +18433,7 @@ async def test_payment_intents_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.retrieve_async("pi_xxxxxxxxxxxxx") + await client.v1.payment_intents.retrieve_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", @@ -13997,6 +18441,30 @@ async def test_payment_intents_get_2_service_async( api_base="https://api.stripe.com", ) + def test_payment_intents_increment_authorization_post_service_non_namespaced( + 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", + ) + def test_payment_intents_increment_authorization_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -14023,7 +18491,7 @@ def test_payment_intents_increment_authorization_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.increment_authorization( + client.v1.payment_intents.increment_authorization( "pi_xxxxxxxxxxxxx", {"amount": 2099}, ) @@ -14063,7 +18531,7 @@ async def test_payment_intents_increment_authorization_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.increment_authorization_async( + await client.v1.payment_intents.increment_authorization_async( "pi_xxxxxxxxxxxxx", {"amount": 2099}, ) @@ -14075,6 +18543,33 @@ async def test_payment_intents_increment_authorization_post_service_async( post_data="amount=2099", ) + def test_payment_intents_post_service_non_namespaced( + 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", + ) + def test_payment_intents_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -14102,7 +18597,7 @@ def test_payment_intents_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.create( + client.v1.payment_intents.create( { "amount": 1099, "currency": "eur", @@ -14146,7 +18641,7 @@ async def test_payment_intents_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.create_async( + await client.v1.payment_intents.create_async( { "amount": 1099, "currency": "eur", @@ -14161,22 +18656,7 @@ async def test_payment_intents_post_service_async( 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( + def test_payment_intents_post_2_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -14203,11 +18683,10 @@ def test_payment_intents_post_2_service( post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=true", ) - @pytest.mark.anyio - async def test_payment_intents_post_2_async( + def test_payment_intents_post_2( self, http_client_mock: HTTPClientMock ) -> None: - await stripe.PaymentIntent.create_async( + stripe.PaymentIntent.create( amount=2000, currency="usd", automatic_payment_methods={"enabled": True}, @@ -14219,8 +18698,7 @@ async def test_payment_intents_post_2_async( post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=true", ) - @pytest.mark.anyio - async def test_payment_intents_post_2_service_async( + def test_payment_intents_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -14232,7 +18710,7 @@ async def test_payment_intents_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.create_async( + client.v1.payment_intents.create( { "amount": 2000, "currency": "usd", @@ -14247,6 +18725,74 @@ async def test_payment_intents_post_2_service_async( 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.v1.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_service_non_namespaced( + 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", + ) + def test_payment_intents_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -14273,7 +18819,7 @@ def test_payment_intents_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.update( + client.v1.payment_intents.update( "pi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -14313,7 +18859,7 @@ async def test_payment_intents_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.update_async( + await client.v1.payment_intents.update_async( "pi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -14325,6 +18871,36 @@ async def test_payment_intents_post_3_service_async( post_data="metadata[order_id]=6735", ) + def test_payment_intents_post_4_service_non_namespaced( + 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", + ) + def test_payment_intents_post_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -14352,7 +18928,7 @@ def test_payment_intents_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.create( + client.v1.payment_intents.create( { "amount": 200, "currency": "usd", @@ -14399,7 +18975,7 @@ async def test_payment_intents_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.create_async( + await client.v1.payment_intents.create_async( { "amount": 200, "currency": "usd", @@ -14417,6 +18993,31 @@ async def test_payment_intents_post_4_service_async( post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", ) + def test_payment_intents_search_get_service_non_namespaced( + 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", + ) + def test_payment_intents_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -14442,7 +19043,7 @@ def test_payment_intents_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.search( + client.v1.payment_intents.search( { "query": "status:'succeeded' AND metadata['order_id']:'6735'", } @@ -14481,7 +19082,7 @@ async def test_payment_intents_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.search_async( + await client.v1.payment_intents.search_async( { "query": "status:'succeeded' AND metadata['order_id']:'6735'", } @@ -14493,6 +19094,26 @@ async def test_payment_intents_search_get_service_async( api_base="https://api.stripe.com", ) + def test_payment_intents_verify_microdeposits_post_service_non_namespaced( + 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", + ) + def test_payment_intents_verify_microdeposits_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -14515,7 +19136,7 @@ def test_payment_intents_verify_microdeposits_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.verify_microdeposits("pi_xxxxxxxxxxxxx") + client.v1.payment_intents.verify_microdeposits("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", @@ -14549,7 +19170,7 @@ async def test_payment_intents_verify_microdeposits_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.verify_microdeposits_async( + await client.v1.payment_intents.verify_microdeposits_async( "pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -14559,6 +19180,30 @@ async def test_payment_intents_verify_microdeposits_post_service_async( api_base="https://api.stripe.com", ) + def test_payment_intents_verify_microdeposits_post_2_service_non_namespaced( + 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", + ) + def test_payment_intents_verify_microdeposits_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -14585,7 +19230,7 @@ def test_payment_intents_verify_microdeposits_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_intents.verify_microdeposits( + client.v1.payment_intents.verify_microdeposits( "pi_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) @@ -14625,7 +19270,7 @@ async def test_payment_intents_verify_microdeposits_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_intents.verify_microdeposits_async( + await client.v1.payment_intents.verify_microdeposits_async( "pi_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) @@ -14637,6 +19282,26 @@ async def test_payment_intents_verify_microdeposits_post_2_service_async( post_data="amounts[0]=32&amounts[1]=45", ) + def test_payment_links_get_service_non_namespaced( + 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", + ) + def test_payment_links_get(self, http_client_mock: HTTPClientMock) -> None: stripe.PaymentLink.retrieve("pl_xyz") http_client_mock.assert_requested( @@ -14657,7 +19322,7 @@ def test_payment_links_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.retrieve("pl_xyz") + client.v1.payment_links.retrieve("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz", @@ -14689,7 +19354,7 @@ async def test_payment_links_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_links.retrieve_async("pl_xyz") + await client.v1.payment_links.retrieve_async("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz", @@ -14697,6 +19362,27 @@ async def test_payment_links_get_service_async( api_base="https://api.stripe.com", ) + def test_payment_links_get_2_service_non_namespaced( + 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", + ) + def test_payment_links_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -14720,7 +19406,7 @@ def test_payment_links_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.list({"limit": 3}) + client.v1.payment_links.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_links", @@ -14753,7 +19439,7 @@ async def test_payment_links_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_links.list_async({"limit": 3}) + await client.v1.payment_links.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_links", @@ -14761,6 +19447,26 @@ async def test_payment_links_get_2_service_async( api_base="https://api.stripe.com", ) + def test_payment_links_get_3_service_non_namespaced( + 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", + ) + def test_payment_links_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -14783,7 +19489,7 @@ def test_payment_links_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.retrieve("plink_xxxxxxxxxxxxx") + client.v1.payment_links.retrieve("plink_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_links/plink_xxxxxxxxxxxxx", @@ -14815,7 +19521,7 @@ async def test_payment_links_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_links.retrieve_async("plink_xxxxxxxxxxxxx") + await client.v1.payment_links.retrieve_async("plink_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_links/plink_xxxxxxxxxxxxx", @@ -14823,6 +19529,26 @@ async def test_payment_links_get_3_service_async( api_base="https://api.stripe.com", ) + def test_payment_links_line_items_get_service_non_namespaced( + 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", + ) + def test_payment_links_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -14845,7 +19571,7 @@ def test_payment_links_line_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.line_items.list("pl_xyz") + client.v1.payment_links.line_items.list("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz/line_items", @@ -14877,7 +19603,7 @@ async def test_payment_links_line_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_links.line_items.list_async("pl_xyz") + await client.v1.payment_links.line_items.list_async("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz/line_items", @@ -14885,20 +19611,7 @@ async def test_payment_links_line_items_get_service_async( 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( + def test_payment_links_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -14925,6 +19638,46 @@ def test_payment_links_post_service( post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) + 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.v1.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 @@ -14952,7 +19705,34 @@ async def test_payment_links_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_links.create_async( + await client.v1.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_service_non_namespaced( + 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} @@ -14992,7 +19772,7 @@ def test_payment_links_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.create( + client.v1.payment_links.create( { "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} @@ -15034,7 +19814,7 @@ async def test_payment_links_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_links.create_async( + await client.v1.payment_links.create_async( { "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} @@ -15049,6 +19829,30 @@ async def test_payment_links_post_2_service_async( post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) + def test_payment_links_post_3_service_non_namespaced( + 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", + ) + def test_payment_links_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -15075,7 +19879,7 @@ def test_payment_links_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_links.update( + client.v1.payment_links.update( "plink_xxxxxxxxxxxxx", {"active": False}, ) @@ -15115,7 +19919,7 @@ async def test_payment_links_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_links.update_async( + await client.v1.payment_links.update_async( "plink_xxxxxxxxxxxxx", {"active": False}, ) @@ -15127,6 +19931,27 @@ async def test_payment_links_post_3_service_async( post_data="active=false", ) + def test_payment_method_configurations_get_service_non_namespaced( + 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", + ) + def test_payment_method_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -15150,7 +19975,7 @@ def test_payment_method_configurations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_method_configurations.list({"application": "foo"}) + client.v1.payment_method_configurations.list({"application": "foo"}) http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations", @@ -15183,7 +20008,7 @@ async def test_payment_method_configurations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_method_configurations.list_async( + await client.v1.payment_method_configurations.list_async( { "application": "foo", } @@ -15195,6 +20020,26 @@ async def test_payment_method_configurations_get_service_async( api_base="https://api.stripe.com", ) + def test_payment_method_configurations_get_2_service_non_namespaced( + 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", + ) + def test_payment_method_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -15217,7 +20062,7 @@ def test_payment_method_configurations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_method_configurations.retrieve("foo") + client.v1.payment_method_configurations.retrieve("foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations/foo", @@ -15249,7 +20094,7 @@ async def test_payment_method_configurations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_method_configurations.retrieve_async("foo") + await client.v1.payment_method_configurations.retrieve_async("foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations/foo", @@ -15257,6 +20102,32 @@ async def test_payment_method_configurations_get_2_service_async( api_base="https://api.stripe.com", ) + def test_payment_method_configurations_post_service_non_namespaced( + 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", + ) + def test_payment_method_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15283,7 +20154,7 @@ def test_payment_method_configurations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_method_configurations.create( + client.v1.payment_method_configurations.create( { "acss_debit": {"display_preference": {"preference": "none"}}, "affirm": {"display_preference": {"preference": "none"}}, @@ -15325,7 +20196,7 @@ async def test_payment_method_configurations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_method_configurations.create_async( + await client.v1.payment_method_configurations.create_async( { "acss_debit": {"display_preference": {"preference": "none"}}, "affirm": {"display_preference": {"preference": "none"}}, @@ -15339,6 +20210,30 @@ async def test_payment_method_configurations_post_service_async( post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", ) + def test_payment_method_configurations_post_2_service_non_namespaced( + 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", + ) + def test_payment_method_configurations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -15365,7 +20260,7 @@ def test_payment_method_configurations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_method_configurations.update( + client.v1.payment_method_configurations.update( "foo", {"acss_debit": {"display_preference": {"preference": "on"}}}, ) @@ -15405,7 +20300,7 @@ async def test_payment_method_configurations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_method_configurations.update_async( + await client.v1.payment_method_configurations.update_async( "foo", {"acss_debit": {"display_preference": {"preference": "on"}}}, ) @@ -15417,6 +20312,30 @@ async def test_payment_method_configurations_post_2_service_async( post_data="acss_debit[display_preference][preference]=on", ) + def test_payment_methods_attach_post_service_non_namespaced( + 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", + ) + def test_payment_methods_attach_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15443,7 +20362,7 @@ def test_payment_methods_attach_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.attach( + client.v1.payment_methods.attach( "pm_xxxxxxxxxxxxx", {"customer": "cus_xxxxxxxxxxxxx"}, ) @@ -15483,7 +20402,7 @@ async def test_payment_methods_attach_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_methods.attach_async( + await client.v1.payment_methods.attach_async( "pm_xxxxxxxxxxxxx", {"customer": "cus_xxxxxxxxxxxxx"}, ) @@ -15495,6 +20414,26 @@ async def test_payment_methods_attach_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx", ) + def test_payment_methods_detach_post_service_non_namespaced( + 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", + ) + def test_payment_methods_detach_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15517,7 +20456,7 @@ def test_payment_methods_detach_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.detach("pm_xxxxxxxxxxxxx") + client.v1.payment_methods.detach("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", @@ -15549,7 +20488,7 @@ async def test_payment_methods_detach_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_methods.detach_async("pm_xxxxxxxxxxxxx") + await client.v1.payment_methods.detach_async("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", @@ -15557,6 +20496,32 @@ async def test_payment_methods_detach_post_service_async( api_base="https://api.stripe.com", ) + def test_payment_methods_get_service_non_namespaced( + 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", + ) + def test_payment_methods_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -15583,7 +20548,7 @@ def test_payment_methods_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.list( + client.v1.payment_methods.list( { "customer": "cus_xxxxxxxxxxxxx", "type": "card", @@ -15624,7 +20589,7 @@ async def test_payment_methods_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_methods.list_async( + await client.v1.payment_methods.list_async( { "customer": "cus_xxxxxxxxxxxxx", "type": "card", @@ -15637,6 +20602,26 @@ async def test_payment_methods_get_service_async( api_base="https://api.stripe.com", ) + def test_payment_methods_get_2_service_non_namespaced( + 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", + ) + def test_payment_methods_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -15659,7 +20644,7 @@ def test_payment_methods_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.retrieve("pm_xxxxxxxxxxxxx") + client.v1.payment_methods.retrieve("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", @@ -15691,7 +20676,7 @@ async def test_payment_methods_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_methods.retrieve_async("pm_xxxxxxxxxxxxx") + await client.v1.payment_methods.retrieve_async("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", @@ -15699,6 +20684,37 @@ async def test_payment_methods_get_2_service_async( api_base="https://api.stripe.com", ) + def test_payment_methods_post_service_non_namespaced( + 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", + ) + def test_payment_methods_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15730,7 +20746,7 @@ def test_payment_methods_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.create( + client.v1.payment_methods.create( { "type": "card", "card": { @@ -15782,7 +20798,7 @@ async def test_payment_methods_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_methods.create_async( + await client.v1.payment_methods.create_async( { "type": "card", "card": { @@ -15801,6 +20817,30 @@ async def test_payment_methods_post_service_async( post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", ) + def test_payment_methods_post_2_service_non_namespaced( + 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", + ) + def test_payment_methods_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -15827,7 +20867,7 @@ def test_payment_methods_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payment_methods.update( + client.v1.payment_methods.update( "pm_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -15867,7 +20907,7 @@ async def test_payment_methods_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payment_methods.update_async( + await client.v1.payment_methods.update_async( "pm_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -15879,6 +20919,26 @@ async def test_payment_methods_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_payouts_cancel_post_service_non_namespaced( + 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", + ) + def test_payouts_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15901,7 +20961,7 @@ def test_payouts_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.cancel("po_xxxxxxxxxxxxx") + client.v1.payouts.cancel("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", @@ -15933,7 +20993,7 @@ async def test_payouts_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payouts.cancel_async("po_xxxxxxxxxxxxx") + await client.v1.payouts.cancel_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", @@ -15941,6 +21001,27 @@ async def test_payouts_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_payouts_get_service_non_namespaced( + 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", + ) + def test_payouts_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.list(limit=3) http_client_mock.assert_requested( @@ -15962,7 +21043,7 @@ def test_payouts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.list({"limit": 3}) + client.v1.payouts.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payouts", @@ -15995,7 +21076,7 @@ async def test_payouts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payouts.list_async({"limit": 3}) + await client.v1.payouts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payouts", @@ -16003,6 +21084,26 @@ async def test_payouts_get_service_async( api_base="https://api.stripe.com", ) + def test_payouts_get_2_service_non_namespaced( + 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", + ) + def test_payouts_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.retrieve("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -16023,7 +21124,7 @@ def test_payouts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.retrieve("po_xxxxxxxxxxxxx") + client.v1.payouts.retrieve("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payouts/po_xxxxxxxxxxxxx", @@ -16055,7 +21156,7 @@ async def test_payouts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payouts.retrieve_async("po_xxxxxxxxxxxxx") + await client.v1.payouts.retrieve_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payouts/po_xxxxxxxxxxxxx", @@ -16063,6 +21164,27 @@ async def test_payouts_get_2_service_async( api_base="https://api.stripe.com", ) + def test_payouts_post_service_non_namespaced( + 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", + ) + def test_payouts_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.create( amount=1100, @@ -16087,7 +21209,7 @@ def test_payouts_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.create({"amount": 1100, "currency": "usd"}) + client.v1.payouts.create({"amount": 1100, "currency": "usd"}) http_client_mock.assert_requested( "post", path="/v1/payouts", @@ -16124,7 +21246,12 @@ async def test_payouts_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payouts.create_async({"amount": 1100, "currency": "usd"}) + await client.v1.payouts.create_async( + { + "amount": 1100, + "currency": "usd", + } + ) http_client_mock.assert_requested( "post", path="/v1/payouts", @@ -16133,6 +21260,30 @@ async def test_payouts_post_service_async( post_data="amount=1100¤cy=usd", ) + def test_payouts_post_2_service_non_namespaced( + 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", + ) + def test_payouts_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.modify( "po_xxxxxxxxxxxxx", @@ -16157,7 +21308,7 @@ def test_payouts_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.update( + client.v1.payouts.update( "po_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -16197,7 +21348,7 @@ async def test_payouts_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payouts.update_async( + await client.v1.payouts.update_async( "po_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -16209,6 +21360,26 @@ async def test_payouts_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_payouts_reverse_post_service_non_namespaced( + 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", + ) + def test_payouts_reverse_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -16231,7 +21402,7 @@ def test_payouts_reverse_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.payouts.reverse("po_xxxxxxxxxxxxx") + client.v1.payouts.reverse("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", @@ -16263,7 +21434,7 @@ async def test_payouts_reverse_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.payouts.reverse_async("po_xxxxxxxxxxxxx") + await client.v1.payouts.reverse_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", @@ -16271,6 +21442,26 @@ async def test_payouts_reverse_post_service_async( api_base="https://api.stripe.com", ) + def test_plans_delete_service_non_namespaced( + 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", + ) + def test_plans_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.delete("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -16291,7 +21482,7 @@ def test_plans_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.plans.delete("price_xxxxxxxxxxxxx") + client.v1.plans.delete("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/plans/price_xxxxxxxxxxxxx", @@ -16323,7 +21514,7 @@ async def test_plans_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.plans.delete_async("price_xxxxxxxxxxxxx") + await client.v1.plans.delete_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/plans/price_xxxxxxxxxxxxx", @@ -16331,6 +21522,27 @@ async def test_plans_delete_service_async( api_base="https://api.stripe.com", ) + def test_plans_get_service_non_namespaced( + 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", + ) + def test_plans_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.list(limit=3) http_client_mock.assert_requested( @@ -16350,7 +21562,7 @@ def test_plans_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client=http_client_mock.get_mock_http_client(), ) - client.plans.list({"limit": 3}) + client.v1.plans.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/plans", @@ -16383,7 +21595,7 @@ async def test_plans_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.plans.list_async({"limit": 3}) + await client.v1.plans.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/plans", @@ -16391,6 +21603,26 @@ async def test_plans_get_service_async( api_base="https://api.stripe.com", ) + def test_plans_get_2_service_non_namespaced( + 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", + ) + def test_plans_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -16411,7 +21643,7 @@ def test_plans_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.plans.retrieve("price_xxxxxxxxxxxxx") + client.v1.plans.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/plans/price_xxxxxxxxxxxxx", @@ -16443,7 +21675,7 @@ async def test_plans_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.plans.retrieve_async("price_xxxxxxxxxxxxx") + await client.v1.plans.retrieve_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/plans/price_xxxxxxxxxxxxx", @@ -16451,21 +21683,7 @@ async def test_plans_get_2_service_async( 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( + def test_plans_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -16493,6 +21711,48 @@ def test_plans_post_service( post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) + 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.v1.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 @@ -16523,7 +21783,7 @@ async def test_plans_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.plans.create_async( + await client.v1.plans.create_async( { "amount": 2000, "currency": "usd", @@ -16539,6 +21799,34 @@ async def test_plans_post_service_async( post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) + def test_plans_post_2_service_non_namespaced( + 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", + ) + def test_plans_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.create( amount=2000, @@ -16565,7 +21853,7 @@ def test_plans_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.plans.create( + client.v1.plans.create( { "amount": 2000, "currency": "usd", @@ -16611,7 +21899,7 @@ async def test_plans_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.plans.create_async( + await client.v1.plans.create_async( { "amount": 2000, "currency": "usd", @@ -16627,6 +21915,30 @@ async def test_plans_post_2_service_async( post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", ) + def test_plans_post_3_service_non_namespaced( + 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", + ) + def test_plans_post_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.modify( "price_xxxxxxxxxxxxx", @@ -16651,7 +21963,7 @@ def test_plans_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.plans.update( + client.v1.plans.update( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -16691,7 +22003,7 @@ async def test_plans_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.plans.update_async( + await client.v1.plans.update_async( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -16703,6 +22015,27 @@ async def test_plans_post_3_service_async( post_data="metadata[order_id]=6735", ) + def test_prices_get_service_non_namespaced( + 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", + ) + def test_prices_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.list(limit=3) http_client_mock.assert_requested( @@ -16724,7 +22057,7 @@ def test_prices_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.prices.list({"limit": 3}) + client.v1.prices.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/prices", @@ -16757,7 +22090,7 @@ async def test_prices_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.prices.list_async({"limit": 3}) + await client.v1.prices.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/prices", @@ -16765,6 +22098,26 @@ async def test_prices_get_service_async( api_base="https://api.stripe.com", ) + def test_prices_get_2_service_non_namespaced( + 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", + ) + def test_prices_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -16785,7 +22138,7 @@ def test_prices_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.prices.retrieve("price_xxxxxxxxxxxxx") + client.v1.prices.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/prices/price_xxxxxxxxxxxxx", @@ -16817,7 +22170,7 @@ async def test_prices_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.prices.retrieve_async("price_xxxxxxxxxxxxx") + await client.v1.prices.retrieve_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/prices/price_xxxxxxxxxxxxx", @@ -16825,6 +22178,38 @@ async def test_prices_get_2_service_async( api_base="https://api.stripe.com", ) + def test_prices_post_service_non_namespaced( + 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", + ) + def test_prices_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.create( unit_amount=2000, @@ -16855,7 +22240,7 @@ def test_prices_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.prices.create( + client.v1.prices.create( { "unit_amount": 2000, "currency": "usd", @@ -16909,7 +22294,7 @@ async def test_prices_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.prices.create_async( + await client.v1.prices.create_async( { "unit_amount": 2000, "currency": "usd", @@ -16929,6 +22314,34 @@ async def test_prices_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_prices_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.create( unit_amount=2000, @@ -16955,7 +22368,7 @@ def test_prices_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.prices.create( + client.v1.prices.create( { "unit_amount": 2000, "currency": "usd", @@ -17001,7 +22414,7 @@ async def test_prices_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.prices.create_async( + await client.v1.prices.create_async( { "unit_amount": 2000, "currency": "usd", @@ -17017,6 +22430,30 @@ async def test_prices_post_2_service_async( post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) + def test_prices_post_3_service_non_namespaced( + 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", + ) + def test_prices_post_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.modify( "price_xxxxxxxxxxxxx", @@ -17041,7 +22478,7 @@ def test_prices_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.prices.update( + client.v1.prices.update( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -17081,7 +22518,7 @@ async def test_prices_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.prices.update_async( + await client.v1.prices.update_async( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -17093,6 +22530,31 @@ async def test_prices_post_3_service_async( post_data="metadata[order_id]=6735", ) + def test_prices_search_get_service_non_namespaced( + 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", + ) + def test_prices_search_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.search( query="active:'true' AND metadata['order_id']:'6735'", @@ -17116,7 +22578,7 @@ def test_prices_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.prices.search( + client.v1.prices.search( { "query": "active:'true' AND metadata['order_id']:'6735'", } @@ -17155,7 +22617,7 @@ async def test_prices_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.prices.search_async( + await client.v1.prices.search_async( { "query": "active:'true' AND metadata['order_id']:'6735'", } @@ -17167,6 +22629,26 @@ async def test_prices_search_get_service_async( api_base="https://api.stripe.com", ) + def test_products_delete_service_non_namespaced( + 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", + ) + def test_products_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.delete("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -17187,7 +22669,7 @@ def test_products_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.products.delete("prod_xxxxxxxxxxxxx") + client.v1.products.delete("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/products/prod_xxxxxxxxxxxxx", @@ -17219,7 +22701,7 @@ async def test_products_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.products.delete_async("prod_xxxxxxxxxxxxx") + await client.v1.products.delete_async("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/products/prod_xxxxxxxxxxxxx", @@ -17227,6 +22709,27 @@ async def test_products_delete_service_async( api_base="https://api.stripe.com", ) + def test_products_get_service_non_namespaced( + 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", + ) + def test_products_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.list(limit=3) http_client_mock.assert_requested( @@ -17248,7 +22751,7 @@ def test_products_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.products.list({"limit": 3}) + client.v1.products.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/products", @@ -17281,7 +22784,7 @@ async def test_products_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.products.list_async({"limit": 3}) + await client.v1.products.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/products", @@ -17289,6 +22792,26 @@ async def test_products_get_service_async( api_base="https://api.stripe.com", ) + def test_products_get_2_service_non_namespaced( + 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", + ) + def test_products_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.retrieve("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -17309,7 +22832,7 @@ def test_products_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.products.retrieve("prod_xxxxxxxxxxxxx") + client.v1.products.retrieve("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/products/prod_xxxxxxxxxxxxx", @@ -17341,7 +22864,7 @@ async def test_products_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.products.retrieve_async("prod_xxxxxxxxxxxxx") + await client.v1.products.retrieve_async("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/products/prod_xxxxxxxxxxxxx", @@ -17349,6 +22872,27 @@ async def test_products_get_2_service_async( api_base="https://api.stripe.com", ) + def test_products_post_service_non_namespaced( + 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", + ) + def test_products_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.create(name="Gold Special") http_client_mock.assert_requested( @@ -17370,7 +22914,7 @@ def test_products_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.products.create({"name": "Gold Special"}) + client.v1.products.create({"name": "Gold Special"}) http_client_mock.assert_requested( "post", path="/v1/products", @@ -17404,7 +22948,7 @@ async def test_products_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.products.create_async({"name": "Gold Special"}) + await client.v1.products.create_async({"name": "Gold Special"}) http_client_mock.assert_requested( "post", path="/v1/products", @@ -17413,6 +22957,30 @@ async def test_products_post_service_async( post_data="name=Gold%20Special", ) + def test_products_post_2_service_non_namespaced( + 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", + ) + def test_products_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.modify( "prod_xxxxxxxxxxxxx", @@ -17437,7 +23005,7 @@ def test_products_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.products.update( + client.v1.products.update( "prod_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -17477,7 +23045,7 @@ async def test_products_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.products.update_async( + await client.v1.products.update_async( "prod_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -17489,6 +23057,31 @@ async def test_products_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_products_search_get_service_non_namespaced( + 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", + ) + def test_products_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -17514,7 +23107,7 @@ def test_products_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.products.search( + client.v1.products.search( { "query": "active:'true' AND metadata['order_id']:'6735'", } @@ -17553,7 +23146,7 @@ async def test_products_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.products.search_async( + await client.v1.products.search_async( { "query": "active:'true' AND metadata['order_id']:'6735'", } @@ -17565,6 +23158,27 @@ async def test_products_search_get_service_async( api_base="https://api.stripe.com", ) + def test_promotion_codes_get_service_non_namespaced( + 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", + ) + def test_promotion_codes_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -17588,7 +23202,7 @@ def test_promotion_codes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.promotion_codes.list({"limit": 3}) + client.v1.promotion_codes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/promotion_codes", @@ -17621,7 +23235,7 @@ async def test_promotion_codes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.promotion_codes.list_async({"limit": 3}) + await client.v1.promotion_codes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/promotion_codes", @@ -17629,6 +23243,26 @@ async def test_promotion_codes_get_service_async( api_base="https://api.stripe.com", ) + def test_promotion_codes_get_2_service_non_namespaced( + 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", + ) + def test_promotion_codes_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -17651,7 +23285,7 @@ def test_promotion_codes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.promotion_codes.retrieve("promo_xxxxxxxxxxxxx") + client.v1.promotion_codes.retrieve("promo_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", @@ -17683,7 +23317,7 @@ async def test_promotion_codes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.promotion_codes.retrieve_async("promo_xxxxxxxxxxxxx") + await client.v1.promotion_codes.retrieve_async("promo_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", @@ -17691,6 +23325,27 @@ async def test_promotion_codes_get_2_service_async( api_base="https://api.stripe.com", ) + def test_promotion_codes_post_service_non_namespaced( + 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", + ) + def test_promotion_codes_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -17714,7 +23369,7 @@ def test_promotion_codes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.promotion_codes.create({"coupon": "Z4OV52SU"}) + client.v1.promotion_codes.create({"coupon": "Z4OV52SU"}) http_client_mock.assert_requested( "post", path="/v1/promotion_codes", @@ -17748,7 +23403,7 @@ async def test_promotion_codes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.promotion_codes.create_async({"coupon": "Z4OV52SU"}) + await client.v1.promotion_codes.create_async({"coupon": "Z4OV52SU"}) http_client_mock.assert_requested( "post", path="/v1/promotion_codes", @@ -17757,6 +23412,30 @@ async def test_promotion_codes_post_service_async( post_data="coupon=Z4OV52SU", ) + def test_promotion_codes_post_2_service_non_namespaced( + 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", + ) + def test_promotion_codes_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -17783,7 +23462,7 @@ def test_promotion_codes_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.promotion_codes.update( + client.v1.promotion_codes.update( "promo_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -17823,7 +23502,7 @@ async def test_promotion_codes_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.promotion_codes.update_async( + await client.v1.promotion_codes.update_async( "promo_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -17835,6 +23514,26 @@ async def test_promotion_codes_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_quotes_accept_post_service_non_namespaced( + 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", + ) + def test_quotes_accept_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -17857,7 +23556,7 @@ def test_quotes_accept_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.accept("qt_xxxxxxxxxxxxx") + client.v1.quotes.accept("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", @@ -17889,7 +23588,7 @@ async def test_quotes_accept_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.quotes.accept_async("qt_xxxxxxxxxxxxx") + await client.v1.quotes.accept_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", @@ -17897,6 +23596,26 @@ async def test_quotes_accept_post_service_async( api_base="https://api.stripe.com", ) + def test_quotes_cancel_post_service_non_namespaced( + 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", + ) + def test_quotes_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -17919,7 +23638,7 @@ def test_quotes_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.cancel("qt_xxxxxxxxxxxxx") + client.v1.quotes.cancel("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", @@ -17951,7 +23670,7 @@ async def test_quotes_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.quotes.cancel_async("qt_xxxxxxxxxxxxx") + await client.v1.quotes.cancel_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", @@ -17959,6 +23678,26 @@ async def test_quotes_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_quotes_finalize_post_service_non_namespaced( + 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", + ) + def test_quotes_finalize_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -17981,7 +23720,7 @@ def test_quotes_finalize_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.finalize_quote("qt_xxxxxxxxxxxxx") + client.v1.quotes.finalize_quote("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", @@ -18013,7 +23752,7 @@ async def test_quotes_finalize_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.quotes.finalize_quote_async("qt_xxxxxxxxxxxxx") + await client.v1.quotes.finalize_quote_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", @@ -18021,6 +23760,27 @@ async def test_quotes_finalize_post_service_async( api_base="https://api.stripe.com", ) + def test_quotes_get_service_non_namespaced( + 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", + ) + def test_quotes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.list(limit=3) http_client_mock.assert_requested( @@ -18042,7 +23802,7 @@ def test_quotes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.list({"limit": 3}) + client.v1.quotes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/quotes", @@ -18075,7 +23835,7 @@ async def test_quotes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.quotes.list_async({"limit": 3}) + await client.v1.quotes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/quotes", @@ -18083,6 +23843,26 @@ async def test_quotes_get_service_async( api_base="https://api.stripe.com", ) + def test_quotes_get_2_service_non_namespaced( + 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", + ) + def test_quotes_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.retrieve("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -18103,7 +23883,7 @@ def test_quotes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.retrieve("qt_xxxxxxxxxxxxx") + client.v1.quotes.retrieve("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx", @@ -18135,7 +23915,7 @@ async def test_quotes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.quotes.retrieve_async("qt_xxxxxxxxxxxxx") + await client.v1.quotes.retrieve_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx", @@ -18143,6 +23923,26 @@ async def test_quotes_get_2_service_async( api_base="https://api.stripe.com", ) + def test_quotes_line_items_get_service_non_namespaced( + 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", + ) + def test_quotes_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -18165,7 +23965,7 @@ def test_quotes_line_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.line_items.list("qt_xxxxxxxxxxxxx") + client.v1.quotes.line_items.list("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", @@ -18197,7 +23997,7 @@ async def test_quotes_line_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.quotes.line_items.list_async("qt_xxxxxxxxxxxxx") + await client.v1.quotes.line_items.list_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", @@ -18205,6 +24005,26 @@ async def test_quotes_line_items_get_service_async( api_base="https://api.stripe.com", ) + def test_quotes_pdf_get_service_non_namespaced( + 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", + ) + def test_quotes_pdf_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.pdf("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -18225,7 +24045,7 @@ def test_quotes_pdf_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.pdf("qt_xxxxxxxxxxxxx") + client.v1.quotes.pdf("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", @@ -18257,7 +24077,7 @@ async def test_quotes_pdf_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.quotes.pdf_async("qt_xxxxxxxxxxxxx") + await client.v1.quotes.pdf_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", @@ -18265,6 +24085,34 @@ async def test_quotes_pdf_get_service_async( api_base="https://files.stripe.com", ) + def test_quotes_post_service_non_namespaced( + 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", + ) + def test_quotes_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.create( customer="cus_xxxxxxxxxxxxx", @@ -18289,7 +24137,7 @@ def test_quotes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.create( + client.v1.quotes.create( { "customer": "cus_xxxxxxxxxxxxx", "line_items": [ @@ -18333,7 +24181,7 @@ async def test_quotes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.quotes.create_async( + await client.v1.quotes.create_async( { "customer": "cus_xxxxxxxxxxxxx", "line_items": [ @@ -18349,6 +24197,30 @@ async def test_quotes_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", ) + def test_quotes_post_2_service_non_namespaced( + 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", + ) + def test_quotes_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.modify( "qt_xxxxxxxxxxxxx", @@ -18373,7 +24245,7 @@ def test_quotes_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.quotes.update( + client.v1.quotes.update( "qt_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -18413,7 +24285,7 @@ async def test_quotes_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.quotes.update_async( + await client.v1.quotes.update_async( "qt_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -18425,6 +24297,27 @@ async def test_quotes_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_radar_early_fraud_warnings_get_service_non_namespaced( + 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", + ) + def test_radar_early_fraud_warnings_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -18448,7 +24341,7 @@ def test_radar_early_fraud_warnings_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.early_fraud_warnings.list({"limit": 3}) + client.v1.radar.early_fraud_warnings.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings", @@ -18481,7 +24374,7 @@ async def test_radar_early_fraud_warnings_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.early_fraud_warnings.list_async({"limit": 3}) + await client.v1.radar.early_fraud_warnings.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings", @@ -18489,6 +24382,26 @@ async def test_radar_early_fraud_warnings_get_service_async( api_base="https://api.stripe.com", ) + def test_radar_early_fraud_warnings_get_2_service_non_namespaced( + 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", + ) + def test_radar_early_fraud_warnings_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -18511,7 +24424,7 @@ def test_radar_early_fraud_warnings_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.early_fraud_warnings.retrieve("issfr_xxxxxxxxxxxxx") + client.v1.radar.early_fraud_warnings.retrieve("issfr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", @@ -18545,7 +24458,7 @@ async def test_radar_early_fraud_warnings_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.early_fraud_warnings.retrieve_async( + await client.v1.radar.early_fraud_warnings.retrieve_async( "issfr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -18555,6 +24468,26 @@ async def test_radar_early_fraud_warnings_get_2_service_async( api_base="https://api.stripe.com", ) + def test_radar_value_list_items_delete_service_non_namespaced( + 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", + ) + def test_radar_value_list_items_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -18577,7 +24510,7 @@ def test_radar_value_list_items_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_list_items.delete("rsli_xxxxxxxxxxxxx") + client.v1.radar.value_list_items.delete("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", @@ -18609,7 +24542,9 @@ async def test_radar_value_list_items_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.value_list_items.delete_async("rsli_xxxxxxxxxxxxx") + await client.v1.radar.value_list_items.delete_async( + "rsli_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", @@ -18617,6 +24552,32 @@ async def test_radar_value_list_items_delete_service_async( api_base="https://api.stripe.com", ) + def test_radar_value_list_items_get_service_non_namespaced( + 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", + ) + def test_radar_value_list_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -18643,7 +24604,7 @@ def test_radar_value_list_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_list_items.list( + client.v1.radar.value_list_items.list( { "limit": 3, "value_list": "rsl_xxxxxxxxxxxxx", @@ -18684,7 +24645,7 @@ async def test_radar_value_list_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.value_list_items.list_async( + await client.v1.radar.value_list_items.list_async( { "limit": 3, "value_list": "rsl_xxxxxxxxxxxxx", @@ -18697,6 +24658,26 @@ async def test_radar_value_list_items_get_service_async( api_base="https://api.stripe.com", ) + def test_radar_value_list_items_get_2_service_non_namespaced( + 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", + ) + def test_radar_value_list_items_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -18719,7 +24700,7 @@ def test_radar_value_list_items_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_list_items.retrieve("rsli_xxxxxxxxxxxxx") + client.v1.radar.value_list_items.retrieve("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", @@ -18751,8 +24732,8 @@ async def test_radar_value_list_items_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.value_list_items.retrieve_async( - "rsli_xxxxxxxxxxxxx" + await client.v1.radar.value_list_items.retrieve_async( + "rsli_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", @@ -18761,21 +24742,7 @@ async def test_radar_value_list_items_get_2_service_async( 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( + def test_radar_value_list_items_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -18801,11 +24768,10 @@ def test_radar_value_list_items_post_service( post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", ) - @pytest.mark.anyio - async def test_radar_value_list_items_post_async( + def test_radar_value_list_items_post( self, http_client_mock: HTTPClientMock ) -> None: - await stripe.radar.ValueListItem.create_async( + stripe.radar.ValueListItem.create( value_list="rsl_xxxxxxxxxxxxx", value="1.2.3.4", ) @@ -18816,8 +24782,7 @@ async def test_radar_value_list_items_post_async( post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", ) - @pytest.mark.anyio - async def test_radar_value_list_items_post_service_async( + def test_radar_value_list_items_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -18829,7 +24794,7 @@ async def test_radar_value_list_items_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.value_list_items.create_async( + client.v1.radar.value_list_items.create( { "value_list": "rsl_xxxxxxxxxxxxx", "value": "1.2.3.4", @@ -18843,6 +24808,68 @@ async def test_radar_value_list_items_post_service_async( 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.v1.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_service_non_namespaced( + 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", + ) + def test_radar_value_lists_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -18865,7 +24892,7 @@ def test_radar_value_lists_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.delete("rsl_xxxxxxxxxxxxx") + client.v1.radar.value_lists.delete("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", @@ -18897,7 +24924,7 @@ async def test_radar_value_lists_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.value_lists.delete_async("rsl_xxxxxxxxxxxxx") + await client.v1.radar.value_lists.delete_async("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", @@ -18905,6 +24932,27 @@ async def test_radar_value_lists_delete_service_async( api_base="https://api.stripe.com", ) + def test_radar_value_lists_get_service_non_namespaced( + 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", + ) + def test_radar_value_lists_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -18928,7 +24976,7 @@ def test_radar_value_lists_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.list({"limit": 3}) + client.v1.radar.value_lists.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/value_lists", @@ -18961,7 +25009,7 @@ async def test_radar_value_lists_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.value_lists.list_async({"limit": 3}) + await client.v1.radar.value_lists.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/value_lists", @@ -18969,6 +25017,26 @@ async def test_radar_value_lists_get_service_async( api_base="https://api.stripe.com", ) + def test_radar_value_lists_get_2_service_non_namespaced( + 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", + ) + def test_radar_value_lists_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -18991,7 +25059,7 @@ def test_radar_value_lists_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.retrieve("rsl_xxxxxxxxxxxxx") + client.v1.radar.value_lists.retrieve("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", @@ -19023,7 +25091,7 @@ async def test_radar_value_lists_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.value_lists.retrieve_async("rsl_xxxxxxxxxxxxx") + await client.v1.radar.value_lists.retrieve_async("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", @@ -19031,6 +25099,33 @@ async def test_radar_value_lists_get_2_service_async( api_base="https://api.stripe.com", ) + def test_radar_value_lists_post_service_non_namespaced( + 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", + ) + def test_radar_value_lists_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -19058,7 +25153,7 @@ def test_radar_value_lists_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.create( + client.v1.radar.value_lists.create( { "alias": "custom_ip_xxxxxxxxxxxxx", "name": "Custom IP Blocklist", @@ -19102,7 +25197,7 @@ async def test_radar_value_lists_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.value_lists.create_async( + await client.v1.radar.value_lists.create_async( { "alias": "custom_ip_xxxxxxxxxxxxx", "name": "Custom IP Blocklist", @@ -19117,6 +25212,30 @@ async def test_radar_value_lists_post_service_async( post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", ) + def test_radar_value_lists_post_2_service_non_namespaced( + 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", + ) + def test_radar_value_lists_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -19143,7 +25262,7 @@ def test_radar_value_lists_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.radar.value_lists.update( + client.v1.radar.value_lists.update( "rsl_xxxxxxxxxxxxx", {"name": "Updated IP Block List"}, ) @@ -19183,7 +25302,7 @@ async def test_radar_value_lists_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.radar.value_lists.update_async( + await client.v1.radar.value_lists.update_async( "rsl_xxxxxxxxxxxxx", {"name": "Updated IP Block List"}, ) @@ -19195,6 +25314,26 @@ async def test_radar_value_lists_post_2_service_async( post_data="name=Updated%20IP%20Block%20List", ) + def test_refunds_cancel_post_service_non_namespaced( + 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", + ) + def test_refunds_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -19217,7 +25356,7 @@ def test_refunds_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.refunds.cancel("re_xxxxxxxxxxxxx") + client.v1.refunds.cancel("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", @@ -19249,7 +25388,7 @@ async def test_refunds_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.refunds.cancel_async("re_xxxxxxxxxxxxx") + await client.v1.refunds.cancel_async("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", @@ -19257,6 +25396,27 @@ async def test_refunds_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_refunds_get_service_non_namespaced( + 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", + ) + def test_refunds_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.list(limit=3) http_client_mock.assert_requested( @@ -19278,7 +25438,7 @@ def test_refunds_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.refunds.list({"limit": 3}) + client.v1.refunds.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/refunds", @@ -19311,7 +25471,7 @@ async def test_refunds_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.refunds.list_async({"limit": 3}) + await client.v1.refunds.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/refunds", @@ -19319,6 +25479,26 @@ async def test_refunds_get_service_async( api_base="https://api.stripe.com", ) + def test_refunds_get_2_service_non_namespaced( + 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", + ) + def test_refunds_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.retrieve("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -19339,7 +25519,7 @@ def test_refunds_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.refunds.retrieve("re_xxxxxxxxxxxxx") + client.v1.refunds.retrieve("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/refunds/re_xxxxxxxxxxxxx", @@ -19371,7 +25551,7 @@ async def test_refunds_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.refunds.retrieve_async("re_xxxxxxxxxxxxx") + await client.v1.refunds.retrieve_async("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/refunds/re_xxxxxxxxxxxxx", @@ -19379,6 +25559,27 @@ async def test_refunds_get_2_service_async( api_base="https://api.stripe.com", ) + def test_refunds_post_service_non_namespaced( + 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", + ) + def test_refunds_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.create(charge="ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -19400,7 +25601,7 @@ def test_refunds_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.refunds.create({"charge": "ch_xxxxxxxxxxxxx"}) + client.v1.refunds.create({"charge": "ch_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/refunds", @@ -19434,7 +25635,7 @@ async def test_refunds_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.refunds.create_async({"charge": "ch_xxxxxxxxxxxxx"}) + await client.v1.refunds.create_async({"charge": "ch_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/refunds", @@ -19443,19 +25644,7 @@ async def test_refunds_post_service_async( 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( + def test_refunds_post_2_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -19479,11 +25668,8 @@ def test_refunds_post_2_service( 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( + def test_refunds_post_2(self, http_client_mock: HTTPClientMock) -> None: + stripe.Refund.modify( "re_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) @@ -19494,8 +25680,7 @@ async def test_refunds_post_2_async( post_data="metadata[order_id]=6735", ) - @pytest.mark.anyio - async def test_refunds_post_2_service_async( + def test_refunds_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -19507,7 +25692,7 @@ async def test_refunds_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.refunds.update_async( + client.v1.refunds.update( "re_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -19519,6 +25704,67 @@ async def test_refunds_post_2_service_async( 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.v1.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_service_non_namespaced( + 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", + ) + def test_reporting_report_runs_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -19542,7 +25788,7 @@ def test_reporting_report_runs_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_runs.list({"limit": 3}) + client.v1.reporting.report_runs.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs", @@ -19575,7 +25821,7 @@ async def test_reporting_report_runs_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.reporting.report_runs.list_async({"limit": 3}) + await client.v1.reporting.report_runs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs", @@ -19583,6 +25829,26 @@ async def test_reporting_report_runs_get_service_async( api_base="https://api.stripe.com", ) + def test_reporting_report_runs_get_2_service_non_namespaced( + 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", + ) + def test_reporting_report_runs_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -19605,7 +25871,7 @@ def test_reporting_report_runs_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_runs.retrieve("frr_xxxxxxxxxxxxx") + client.v1.reporting.report_runs.retrieve("frr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", @@ -19637,7 +25903,9 @@ async def test_reporting_report_runs_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.reporting.report_runs.retrieve_async("frr_xxxxxxxxxxxxx") + await client.v1.reporting.report_runs.retrieve_async( + "frr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", @@ -19645,6 +25913,35 @@ async def test_reporting_report_runs_get_2_service_async( api_base="https://api.stripe.com", ) + def test_reporting_report_runs_post_service_non_namespaced( + 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", + ) + def test_reporting_report_runs_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -19674,7 +25971,7 @@ def test_reporting_report_runs_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_runs.create( + client.v1.reporting.report_runs.create( { "report_type": "balance.summary.1", "parameters": { @@ -19722,7 +26019,7 @@ async def test_reporting_report_runs_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.reporting.report_runs.create_async( + await client.v1.reporting.report_runs.create_async( { "report_type": "balance.summary.1", "parameters": { @@ -19739,6 +26036,26 @@ async def test_reporting_report_runs_post_service_async( post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", ) + def test_reporting_report_types_get_service_non_namespaced( + 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", + ) + def test_reporting_report_types_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -19761,7 +26078,7 @@ def test_reporting_report_types_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_types.list() + client.v1.reporting.report_types.list() http_client_mock.assert_requested( "get", path="/v1/reporting/report_types", @@ -19793,7 +26110,7 @@ async def test_reporting_report_types_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.reporting.report_types.list_async() + await client.v1.reporting.report_types.list_async() http_client_mock.assert_requested( "get", path="/v1/reporting/report_types", @@ -19801,6 +26118,26 @@ async def test_reporting_report_types_get_service_async( api_base="https://api.stripe.com", ) + def test_reporting_report_types_get_2_service_non_namespaced( + 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", + ) + def test_reporting_report_types_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -19823,7 +26160,7 @@ def test_reporting_report_types_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.reporting.report_types.retrieve("balance.summary.1") + client.v1.reporting.report_types.retrieve("balance.summary.1") http_client_mock.assert_requested( "get", path="/v1/reporting/report_types/balance.summary.1", @@ -19855,7 +26192,9 @@ async def test_reporting_report_types_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.reporting.report_types.retrieve_async("balance.summary.1") + await client.v1.reporting.report_types.retrieve_async( + "balance.summary.1", + ) http_client_mock.assert_requested( "get", path="/v1/reporting/report_types/balance.summary.1", @@ -19863,6 +26202,26 @@ async def test_reporting_report_types_get_2_service_async( api_base="https://api.stripe.com", ) + def test_reviews_approve_post_service_non_namespaced( + 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", + ) + def test_reviews_approve_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -19885,7 +26244,7 @@ def test_reviews_approve_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.reviews.approve("prv_xxxxxxxxxxxxx") + client.v1.reviews.approve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", @@ -19917,7 +26276,7 @@ async def test_reviews_approve_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.reviews.approve_async("prv_xxxxxxxxxxxxx") + await client.v1.reviews.approve_async("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", @@ -19925,6 +26284,27 @@ async def test_reviews_approve_post_service_async( api_base="https://api.stripe.com", ) + def test_reviews_get_service_non_namespaced( + 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", + ) + def test_reviews_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Review.list(limit=3) http_client_mock.assert_requested( @@ -19946,7 +26326,7 @@ def test_reviews_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.reviews.list({"limit": 3}) + client.v1.reviews.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reviews", @@ -19979,7 +26359,7 @@ async def test_reviews_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.reviews.list_async({"limit": 3}) + await client.v1.reviews.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reviews", @@ -19987,6 +26367,26 @@ async def test_reviews_get_service_async( api_base="https://api.stripe.com", ) + def test_reviews_get_2_service_non_namespaced( + 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", + ) + def test_reviews_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Review.retrieve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -20007,7 +26407,7 @@ def test_reviews_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.reviews.retrieve("prv_xxxxxxxxxxxxx") + client.v1.reviews.retrieve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reviews/prv_xxxxxxxxxxxxx", @@ -20039,7 +26439,7 @@ async def test_reviews_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.reviews.retrieve_async("prv_xxxxxxxxxxxxx") + await client.v1.reviews.retrieve_async("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reviews/prv_xxxxxxxxxxxxx", @@ -20047,6 +26447,27 @@ async def test_reviews_get_2_service_async( api_base="https://api.stripe.com", ) + def test_setup_attempts_get_service_non_namespaced( + 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", + ) + def test_setup_attempts_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -20073,7 +26494,7 @@ def test_setup_attempts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.setup_attempts.list({"limit": 3, "setup_intent": "si_xyz"}) + client.v1.setup_attempts.list({"limit": 3, "setup_intent": "si_xyz"}) http_client_mock.assert_requested( "get", path="/v1/setup_attempts", @@ -20109,7 +26530,7 @@ async def test_setup_attempts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.setup_attempts.list_async( + await client.v1.setup_attempts.list_async( { "limit": 3, "setup_intent": "si_xyz", @@ -20122,6 +26543,26 @@ async def test_setup_attempts_get_service_async( api_base="https://api.stripe.com", ) + def test_setup_intents_cancel_post_service_non_namespaced( + 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", + ) + def test_setup_intents_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -20144,7 +26585,7 @@ def test_setup_intents_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.cancel("seti_xxxxxxxxxxxxx") + client.v1.setup_intents.cancel("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", @@ -20176,7 +26617,7 @@ async def test_setup_intents_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.setup_intents.cancel_async("seti_xxxxxxxxxxxxx") + await client.v1.setup_intents.cancel_async("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", @@ -20184,21 +26625,7 @@ async def test_setup_intents_cancel_post_service_async( 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( + def test_setup_intents_confirm_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -20222,6 +26649,44 @@ def test_setup_intents_confirm_post_service( post_data="payment_method=pm_card_visa", ) + 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.v1.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 @@ -20250,7 +26715,7 @@ async def test_setup_intents_confirm_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.setup_intents.confirm_async( + await client.v1.setup_intents.confirm_async( "seti_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) @@ -20262,6 +26727,27 @@ async def test_setup_intents_confirm_post_service_async( post_data="payment_method=pm_card_visa", ) + def test_setup_intents_get_service_non_namespaced( + 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", + ) + def test_setup_intents_get(self, http_client_mock: HTTPClientMock) -> None: stripe.SetupIntent.list(limit=3) http_client_mock.assert_requested( @@ -20283,7 +26769,7 @@ def test_setup_intents_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.list({"limit": 3}) + client.v1.setup_intents.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/setup_intents", @@ -20316,7 +26802,7 @@ async def test_setup_intents_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.setup_intents.list_async({"limit": 3}) + await client.v1.setup_intents.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/setup_intents", @@ -20324,6 +26810,26 @@ async def test_setup_intents_get_service_async( api_base="https://api.stripe.com", ) + def test_setup_intents_get_2_service_non_namespaced( + 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", + ) + def test_setup_intents_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -20346,7 +26852,7 @@ def test_setup_intents_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.retrieve("seti_xxxxxxxxxxxxx") + client.v1.setup_intents.retrieve("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", @@ -20378,7 +26884,7 @@ async def test_setup_intents_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.setup_intents.retrieve_async("seti_xxxxxxxxxxxxx") + await client.v1.setup_intents.retrieve_async("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", @@ -20386,6 +26892,27 @@ async def test_setup_intents_get_2_service_async( api_base="https://api.stripe.com", ) + def test_setup_intents_post_service_non_namespaced( + 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", + ) + def test_setup_intents_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -20409,7 +26936,7 @@ def test_setup_intents_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.create({"payment_method_types": ["card"]}) + client.v1.setup_intents.create({"payment_method_types": ["card"]}) http_client_mock.assert_requested( "post", path="/v1/setup_intents", @@ -20443,7 +26970,7 @@ async def test_setup_intents_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.setup_intents.create_async( + await client.v1.setup_intents.create_async( { "payment_method_types": ["card"], } @@ -20456,6 +26983,30 @@ async def test_setup_intents_post_service_async( post_data="payment_method_types[0]=card", ) + def test_setup_intents_post_2_service_non_namespaced( + 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", + ) + def test_setup_intents_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -20482,7 +27033,7 @@ def test_setup_intents_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.update( + client.v1.setup_intents.update( "seti_xxxxxxxxxxxxx", {"metadata": {"user_id": "3435453"}}, ) @@ -20522,7 +27073,7 @@ async def test_setup_intents_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.setup_intents.update_async( + await client.v1.setup_intents.update_async( "seti_xxxxxxxxxxxxx", {"metadata": {"user_id": "3435453"}}, ) @@ -20534,6 +27085,26 @@ async def test_setup_intents_post_2_service_async( post_data="metadata[user_id]=3435453", ) + def test_setup_intents_verify_microdeposits_post_service_non_namespaced( + 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", + ) + def test_setup_intents_verify_microdeposits_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -20556,7 +27127,7 @@ def test_setup_intents_verify_microdeposits_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.verify_microdeposits("seti_xxxxxxxxxxxxx") + client.v1.setup_intents.verify_microdeposits("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", @@ -20590,14 +27161,38 @@ async def test_setup_intents_verify_microdeposits_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.setup_intents.verify_microdeposits_async( + await client.v1.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_service_non_namespaced( + 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", ) def test_setup_intents_verify_microdeposits_post_2( @@ -20626,7 +27221,7 @@ def test_setup_intents_verify_microdeposits_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.setup_intents.verify_microdeposits( + client.v1.setup_intents.verify_microdeposits( "seti_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) @@ -20666,7 +27261,7 @@ async def test_setup_intents_verify_microdeposits_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.setup_intents.verify_microdeposits_async( + await client.v1.setup_intents.verify_microdeposits_async( "seti_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) @@ -20678,6 +27273,26 @@ async def test_setup_intents_verify_microdeposits_post_2_service_async( post_data="amounts[0]=32&amounts[1]=45", ) + def test_shipping_rates_get_service_non_namespaced( + 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", + ) + def test_shipping_rates_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -20700,7 +27315,7 @@ def test_shipping_rates_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.list() + client.v1.shipping_rates.list() http_client_mock.assert_requested( "get", path="/v1/shipping_rates", @@ -20732,7 +27347,7 @@ async def test_shipping_rates_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.shipping_rates.list_async() + await client.v1.shipping_rates.list_async() http_client_mock.assert_requested( "get", path="/v1/shipping_rates", @@ -20740,6 +27355,27 @@ async def test_shipping_rates_get_service_async( api_base="https://api.stripe.com", ) + def test_shipping_rates_get_2_service_non_namespaced( + 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", + ) + def test_shipping_rates_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -20763,7 +27399,7 @@ def test_shipping_rates_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.list({"limit": 3}) + client.v1.shipping_rates.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/shipping_rates", @@ -20796,7 +27432,7 @@ async def test_shipping_rates_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.shipping_rates.list_async({"limit": 3}) + await client.v1.shipping_rates.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/shipping_rates", @@ -20804,6 +27440,26 @@ async def test_shipping_rates_get_2_service_async( api_base="https://api.stripe.com", ) + def test_shipping_rates_get_3_service_non_namespaced( + 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", + ) + def test_shipping_rates_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -20826,7 +27482,7 @@ def test_shipping_rates_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.retrieve("shr_xxxxxxxxxxxxx") + client.v1.shipping_rates.retrieve("shr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", @@ -20858,7 +27514,7 @@ async def test_shipping_rates_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.shipping_rates.retrieve_async("shr_xxxxxxxxxxxxx") + await client.v1.shipping_rates.retrieve_async("shr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", @@ -20866,6 +27522,33 @@ async def test_shipping_rates_get_3_service_async( api_base="https://api.stripe.com", ) + def test_shipping_rates_post_service_non_namespaced( + 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", + ) + def test_shipping_rates_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -20893,7 +27576,7 @@ def test_shipping_rates_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.create( + client.v1.shipping_rates.create( { "display_name": "Sample Shipper", "fixed_amount": {"currency": "usd", "amount": 400}, @@ -20937,7 +27620,7 @@ async def test_shipping_rates_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.shipping_rates.create_async( + await client.v1.shipping_rates.create_async( { "display_name": "Sample Shipper", "fixed_amount": {"currency": "usd", "amount": 400}, @@ -20952,22 +27635,7 @@ async def test_shipping_rates_post_service_async( 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( + def test_shipping_rates_post_2_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -20994,6 +27662,48 @@ def test_shipping_rates_post_2_service( post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", ) + 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.v1.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 @@ -21023,7 +27733,7 @@ async def test_shipping_rates_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.shipping_rates.create_async( + await client.v1.shipping_rates.create_async( { "display_name": "Ground shipping", "type": "fixed_amount", @@ -21038,6 +27748,30 @@ async def test_shipping_rates_post_2_service_async( post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", ) + def test_shipping_rates_post_3_service_non_namespaced( + 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", + ) + def test_shipping_rates_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -21064,7 +27798,7 @@ def test_shipping_rates_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.shipping_rates.update( + client.v1.shipping_rates.update( "shr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -21104,7 +27838,7 @@ async def test_shipping_rates_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.shipping_rates.update_async( + await client.v1.shipping_rates.update_async( "shr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -21116,6 +27850,27 @@ async def test_shipping_rates_post_3_service_async( post_data="metadata[order_id]=6735", ) + def test_sigma_scheduled_query_runs_get_service_non_namespaced( + 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", + ) + def test_sigma_scheduled_query_runs_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -21139,7 +27894,7 @@ def test_sigma_scheduled_query_runs_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.sigma.scheduled_query_runs.list({"limit": 3}) + client.v1.sigma.scheduled_query_runs.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs", @@ -21172,7 +27927,7 @@ async def test_sigma_scheduled_query_runs_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.sigma.scheduled_query_runs.list_async({"limit": 3}) + await client.v1.sigma.scheduled_query_runs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs", @@ -21180,6 +27935,26 @@ async def test_sigma_scheduled_query_runs_get_service_async( api_base="https://api.stripe.com", ) + def test_sigma_scheduled_query_runs_get_2_service_non_namespaced( + 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", + ) + def test_sigma_scheduled_query_runs_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -21202,7 +27977,7 @@ def test_sigma_scheduled_query_runs_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.sigma.scheduled_query_runs.retrieve("sqr_xxxxxxxxxxxxx") + client.v1.sigma.scheduled_query_runs.retrieve("sqr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", @@ -21236,7 +28011,7 @@ async def test_sigma_scheduled_query_runs_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.sigma.scheduled_query_runs.retrieve_async( + await client.v1.sigma.scheduled_query_runs.retrieve_async( "sqr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -21246,6 +28021,26 @@ async def test_sigma_scheduled_query_runs_get_2_service_async( api_base="https://api.stripe.com", ) + def test_sources_get_service_non_namespaced( + 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", + ) + def test_sources_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Source.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -21266,7 +28061,7 @@ def test_sources_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.sources.retrieve("src_xxxxxxxxxxxxx") + client.v1.sources.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", @@ -21298,7 +28093,27 @@ async def test_sources_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.sources.retrieve_async("src_xxxxxxxxxxxxx") + await client.v1.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_service_non_namespaced( + 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", @@ -21326,7 +28141,7 @@ def test_sources_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.sources.retrieve("src_xxxxxxxxxxxxx") + client.v1.sources.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", @@ -21358,7 +28173,7 @@ async def test_sources_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.sources.retrieve_async("src_xxxxxxxxxxxxx") + await client.v1.sources.retrieve_async("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", @@ -21366,6 +28181,30 @@ async def test_sources_get_2_service_async( api_base="https://api.stripe.com", ) + def test_sources_post_service_non_namespaced( + 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", + ) + def test_sources_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Source.modify( "src_xxxxxxxxxxxxx", @@ -21390,7 +28229,7 @@ def test_sources_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.sources.update( + client.v1.sources.update( "src_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -21430,7 +28269,7 @@ async def test_sources_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.sources.update_async( + await client.v1.sources.update_async( "src_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -21442,6 +28281,26 @@ async def test_sources_post_service_async( post_data="metadata[order_id]=6735", ) + def test_subscription_items_delete_service_non_namespaced( + 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", + ) + def test_subscription_items_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -21464,7 +28323,7 @@ def test_subscription_items_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.delete("si_xxxxxxxxxxxxx") + client.v1.subscription_items.delete("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscription_items/si_xxxxxxxxxxxxx", @@ -21496,7 +28355,7 @@ async def test_subscription_items_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_items.delete_async("si_xxxxxxxxxxxxx") + await client.v1.subscription_items.delete_async("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscription_items/si_xxxxxxxxxxxxx", @@ -21504,6 +28363,27 @@ async def test_subscription_items_delete_service_async( api_base="https://api.stripe.com", ) + def test_subscription_items_get_service_non_namespaced( + 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", + ) + def test_subscription_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -21527,7 +28407,9 @@ def test_subscription_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.list({"subscription": "sub_xxxxxxxxxxxxx"}) + client.v1.subscription_items.list( + {"subscription": "sub_xxxxxxxxxxxxx"} + ) http_client_mock.assert_requested( "get", path="/v1/subscription_items", @@ -21562,7 +28444,7 @@ async def test_subscription_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_items.list_async( + await client.v1.subscription_items.list_async( { "subscription": "sub_xxxxxxxxxxxxx", } @@ -21574,6 +28456,26 @@ async def test_subscription_items_get_service_async( api_base="https://api.stripe.com", ) + def test_subscription_items_get_2_service_non_namespaced( + 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", + ) + def test_subscription_items_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -21596,7 +28498,7 @@ def test_subscription_items_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.retrieve("si_xxxxxxxxxxxxx") + client.v1.subscription_items.retrieve("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx", @@ -21628,7 +28530,7 @@ async def test_subscription_items_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_items.retrieve_async("si_xxxxxxxxxxxxx") + await client.v1.subscription_items.retrieve_async("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx", @@ -21636,6 +28538,33 @@ async def test_subscription_items_get_2_service_async( api_base="https://api.stripe.com", ) + def test_subscription_items_post_service_non_namespaced( + 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", + ) + def test_subscription_items_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -21663,7 +28592,7 @@ def test_subscription_items_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.create( + client.v1.subscription_items.create( { "subscription": "sub_xxxxxxxxxxxxx", "price": "price_xxxxxxxxxxxxx", @@ -21707,7 +28636,7 @@ async def test_subscription_items_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_items.create_async( + await client.v1.subscription_items.create_async( { "subscription": "sub_xxxxxxxxxxxxx", "price": "price_xxxxxxxxxxxxx", @@ -21722,6 +28651,30 @@ async def test_subscription_items_post_service_async( post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", ) + def test_subscription_items_post_2_service_non_namespaced( + 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", + ) + def test_subscription_items_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -21748,7 +28701,7 @@ def test_subscription_items_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_items.update( + client.v1.subscription_items.update( "si_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -21788,7 +28741,7 @@ async def test_subscription_items_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_items.update_async( + await client.v1.subscription_items.update_async( "si_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -21800,6 +28753,26 @@ async def test_subscription_items_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_subscription_schedules_cancel_post_service_non_namespaced( + 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", + ) + def test_subscription_schedules_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -21822,7 +28795,7 @@ def test_subscription_schedules_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.cancel("sub_sched_xxxxxxxxxxxxx") + client.v1.subscription_schedules.cancel("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", @@ -21856,7 +28829,7 @@ async def test_subscription_schedules_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_schedules.cancel_async( + await client.v1.subscription_schedules.cancel_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -21866,6 +28839,27 @@ async def test_subscription_schedules_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_subscription_schedules_get_service_non_namespaced( + 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", + ) + def test_subscription_schedules_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -21889,7 +28883,7 @@ def test_subscription_schedules_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.list({"limit": 3}) + client.v1.subscription_schedules.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules", @@ -21922,7 +28916,7 @@ async def test_subscription_schedules_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_schedules.list_async({"limit": 3}) + await client.v1.subscription_schedules.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules", @@ -21930,6 +28924,26 @@ async def test_subscription_schedules_get_service_async( api_base="https://api.stripe.com", ) + def test_subscription_schedules_get_2_service_non_namespaced( + 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", + ) + def test_subscription_schedules_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -21952,7 +28966,7 @@ def test_subscription_schedules_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.retrieve("sub_sched_xxxxxxxxxxxxx") + client.v1.subscription_schedules.retrieve("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", @@ -21986,7 +29000,7 @@ async def test_subscription_schedules_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_schedules.retrieve_async( + await client.v1.subscription_schedules.retrieve_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -21996,6 +29010,41 @@ async def test_subscription_schedules_get_2_service_async( api_base="https://api.stripe.com", ) + def test_subscription_schedules_post_service_non_namespaced( + 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", + ) + def test_subscription_schedules_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -22029,7 +29078,7 @@ def test_subscription_schedules_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.create( + client.v1.subscription_schedules.create( { "customer": "cus_xxxxxxxxxxxxx", "start_date": 1676070661, @@ -22087,7 +29136,7 @@ async def test_subscription_schedules_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_schedules.create_async( + await client.v1.subscription_schedules.create_async( { "customer": "cus_xxxxxxxxxxxxx", "start_date": 1676070661, @@ -22110,6 +29159,30 @@ async def test_subscription_schedules_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_subscription_schedules_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -22136,7 +29209,7 @@ def test_subscription_schedules_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.update( + client.v1.subscription_schedules.update( "sub_sched_xxxxxxxxxxxxx", {"end_behavior": "release"}, ) @@ -22176,7 +29249,7 @@ async def test_subscription_schedules_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_schedules.update_async( + await client.v1.subscription_schedules.update_async( "sub_sched_xxxxxxxxxxxxx", {"end_behavior": "release"}, ) @@ -22188,6 +29261,26 @@ async def test_subscription_schedules_post_2_service_async( post_data="end_behavior=release", ) + def test_subscription_schedules_release_post_service_non_namespaced( + 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", + ) + def test_subscription_schedules_release_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -22210,7 +29303,7 @@ def test_subscription_schedules_release_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscription_schedules.release("sub_sched_xxxxxxxxxxxxx") + client.v1.subscription_schedules.release("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", @@ -22244,7 +29337,7 @@ async def test_subscription_schedules_release_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscription_schedules.release_async( + await client.v1.subscription_schedules.release_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -22254,6 +29347,26 @@ async def test_subscription_schedules_release_post_service_async( api_base="https://api.stripe.com", ) + def test_subscriptions_delete_service_non_namespaced( + 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", + ) + def test_subscriptions_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -22276,7 +29389,7 @@ def test_subscriptions_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.cancel("sub_xxxxxxxxxxxxx") + client.v1.subscriptions.cancel("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", @@ -22308,7 +29421,7 @@ async def test_subscriptions_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscriptions.cancel_async("sub_xxxxxxxxxxxxx") + await client.v1.subscriptions.cancel_async("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", @@ -22316,6 +29429,26 @@ async def test_subscriptions_delete_service_async( api_base="https://api.stripe.com", ) + def test_subscriptions_discount_delete_service_non_namespaced( + 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", + ) + def test_subscriptions_discount_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -22338,7 +29471,7 @@ def test_subscriptions_discount_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.delete_discount("sub_xyz") + client.v1.subscriptions.delete_discount("sub_xyz") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xyz/discount", @@ -22370,7 +29503,7 @@ async def test_subscriptions_discount_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscriptions.delete_discount_async("sub_xyz") + await client.v1.subscriptions.delete_discount_async("sub_xyz") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xyz/discount", @@ -22378,6 +29511,27 @@ async def test_subscriptions_discount_delete_service_async( api_base="https://api.stripe.com", ) + def test_subscriptions_get_service_non_namespaced( + 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", + ) + def test_subscriptions_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Subscription.list(limit=3) http_client_mock.assert_requested( @@ -22399,7 +29553,7 @@ def test_subscriptions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.list({"limit": 3}) + client.v1.subscriptions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscriptions", @@ -22432,7 +29586,7 @@ async def test_subscriptions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscriptions.list_async({"limit": 3}) + await client.v1.subscriptions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscriptions", @@ -22440,6 +29594,26 @@ async def test_subscriptions_get_service_async( api_base="https://api.stripe.com", ) + def test_subscriptions_get_2_service_non_namespaced( + 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", + ) + def test_subscriptions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -22462,7 +29636,7 @@ def test_subscriptions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.retrieve("sub_xxxxxxxxxxxxx") + client.v1.subscriptions.retrieve("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", @@ -22494,7 +29668,7 @@ async def test_subscriptions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscriptions.retrieve_async("sub_xxxxxxxxxxxxx") + await client.v1.subscriptions.retrieve_async("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", @@ -22502,21 +29676,7 @@ async def test_subscriptions_get_2_service_async( 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( + def test_subscriptions_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -22542,6 +29702,46 @@ def test_subscriptions_post_service( post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) + 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.v1.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 @@ -22570,7 +29770,7 @@ async def test_subscriptions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscriptions.create_async( + await client.v1.subscriptions.create_async( { "customer": "cus_xxxxxxxxxxxxx", "items": [{"price": "price_xxxxxxxxxxxxx"}], @@ -22584,6 +29784,30 @@ async def test_subscriptions_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) + def test_subscriptions_post_2_service_non_namespaced( + 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", + ) + def test_subscriptions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -22610,7 +29834,7 @@ def test_subscriptions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.update( + client.v1.subscriptions.update( "sub_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -22650,7 +29874,7 @@ async def test_subscriptions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscriptions.update_async( + await client.v1.subscriptions.update_async( "sub_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -22662,6 +29886,31 @@ async def test_subscriptions_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_subscriptions_search_get_service_non_namespaced( + 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", + ) + def test_subscriptions_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -22687,7 +29936,7 @@ def test_subscriptions_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.subscriptions.search( + client.v1.subscriptions.search( { "query": "status:'active' AND metadata['order_id']:'6735'", } @@ -22726,7 +29975,7 @@ async def test_subscriptions_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.subscriptions.search_async( + await client.v1.subscriptions.search_async( { "query": "status:'active' AND metadata['order_id']:'6735'", } @@ -22738,6 +29987,26 @@ async def test_subscriptions_search_get_service_async( api_base="https://api.stripe.com", ) + def test_tax_calculations_line_items_get_service_non_namespaced( + 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", + ) + def test_tax_calculations_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -22760,7 +30029,7 @@ def test_tax_calculations_line_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax.calculations.line_items.list("xxx") + client.v1.tax.calculations.line_items.list("xxx") http_client_mock.assert_requested( "get", path="/v1/tax/calculations/xxx/line_items", @@ -22792,7 +30061,7 @@ async def test_tax_calculations_line_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax.calculations.line_items.list_async("xxx") + await client.v1.tax.calculations.line_items.list_async("xxx") http_client_mock.assert_requested( "get", path="/v1/tax/calculations/xxx/line_items", @@ -22800,6 +30069,42 @@ async def test_tax_calculations_line_items_get_service_async( api_base="https://api.stripe.com", ) + def test_tax_calculations_post_service_non_namespaced( + 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", + ) + def test_tax_calculations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -22836,7 +30141,7 @@ def test_tax_calculations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax.calculations.create( + client.v1.tax.calculations.create( { "currency": "usd", "line_items": [{"amount": 1000, "reference": "L1"}], @@ -22898,7 +30203,7 @@ async def test_tax_calculations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax.calculations.create_async( + await client.v1.tax.calculations.create_async( { "currency": "usd", "line_items": [{"amount": 1000, "reference": "L1"}], @@ -22922,6 +30227,27 @@ async def test_tax_calculations_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_tax_codes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxCode.list(limit=3) http_client_mock.assert_requested( @@ -22943,7 +30269,7 @@ def test_tax_codes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_codes.list({"limit": 3}) + client.v1.tax_codes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_codes", @@ -22976,7 +30302,7 @@ async def test_tax_codes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_codes.list_async({"limit": 3}) + await client.v1.tax_codes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_codes", @@ -22984,6 +30310,26 @@ async def test_tax_codes_get_service_async( api_base="https://api.stripe.com", ) + def test_tax_codes_get_2_service_non_namespaced( + 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", + ) + def test_tax_codes_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxCode.retrieve("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -23004,7 +30350,7 @@ def test_tax_codes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_codes.retrieve("txcd_xxxxxxxxxxxxx") + client.v1.tax_codes.retrieve("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", @@ -23036,7 +30382,7 @@ async def test_tax_codes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_codes.retrieve_async("txcd_xxxxxxxxxxxxx") + await client.v1.tax_codes.retrieve_async("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", @@ -23044,6 +30390,26 @@ async def test_tax_codes_get_2_service_async( api_base="https://api.stripe.com", ) + def test_tax_ids_delete_service_non_namespaced( + 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", + ) + def test_tax_ids_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.delete("taxid_123") http_client_mock.assert_requested( @@ -23064,7 +30430,7 @@ def test_tax_ids_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_ids.delete("taxid_123") + client.v1.tax_ids.delete("taxid_123") http_client_mock.assert_requested( "delete", path="/v1/tax_ids/taxid_123", @@ -23096,7 +30462,7 @@ async def test_tax_ids_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_ids.delete_async("taxid_123") + await client.v1.tax_ids.delete_async("taxid_123") http_client_mock.assert_requested( "delete", path="/v1/tax_ids/taxid_123", @@ -23104,6 +30470,26 @@ async def test_tax_ids_delete_service_async( api_base="https://api.stripe.com", ) + def test_tax_ids_get_service_non_namespaced( + 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", + ) + def test_tax_ids_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.list() http_client_mock.assert_requested( @@ -23124,7 +30510,7 @@ def test_tax_ids_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_ids.list() + client.v1.tax_ids.list() http_client_mock.assert_requested( "get", path="/v1/tax_ids", @@ -23156,7 +30542,7 @@ async def test_tax_ids_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_ids.list_async() + await client.v1.tax_ids.list_async() http_client_mock.assert_requested( "get", path="/v1/tax_ids", @@ -23164,6 +30550,26 @@ async def test_tax_ids_get_service_async( api_base="https://api.stripe.com", ) + def test_tax_ids_get_2_service_non_namespaced( + 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", + ) + def test_tax_ids_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.retrieve("taxid_123") http_client_mock.assert_requested( @@ -23184,7 +30590,7 @@ def test_tax_ids_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_ids.retrieve("taxid_123") + client.v1.tax_ids.retrieve("taxid_123") http_client_mock.assert_requested( "get", path="/v1/tax_ids/taxid_123", @@ -23216,7 +30622,7 @@ async def test_tax_ids_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_ids.retrieve_async("taxid_123") + await client.v1.tax_ids.retrieve_async("taxid_123") http_client_mock.assert_requested( "get", path="/v1/tax_ids/taxid_123", @@ -23224,6 +30630,27 @@ async def test_tax_ids_get_2_service_async( api_base="https://api.stripe.com", ) + def test_tax_ids_post_service_non_namespaced( + 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", + ) + def test_tax_ids_post(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.create( type="eu_vat", @@ -23248,7 +30675,7 @@ def test_tax_ids_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_ids.create({"type": "eu_vat", "value": "123"}) + client.v1.tax_ids.create({"type": "eu_vat", "value": "123"}) http_client_mock.assert_requested( "post", path="/v1/tax_ids", @@ -23285,7 +30712,9 @@ async def test_tax_ids_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_ids.create_async({"type": "eu_vat", "value": "123"}) + await client.v1.tax_ids.create_async( + {"type": "eu_vat", "value": "123"} + ) http_client_mock.assert_requested( "post", path="/v1/tax_ids", @@ -23294,6 +30723,27 @@ async def test_tax_ids_post_service_async( post_data="type=eu_vat&value=123", ) + def test_tax_rates_get_service_non_namespaced( + 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", + ) + def test_tax_rates_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.list(limit=3) http_client_mock.assert_requested( @@ -23315,7 +30765,7 @@ def test_tax_rates_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_rates.list({"limit": 3}) + client.v1.tax_rates.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_rates", @@ -23348,7 +30798,7 @@ async def test_tax_rates_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_rates.list_async({"limit": 3}) + await client.v1.tax_rates.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_rates", @@ -23356,6 +30806,26 @@ async def test_tax_rates_get_service_async( api_base="https://api.stripe.com", ) + def test_tax_rates_get_2_service_non_namespaced( + 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", + ) + def test_tax_rates_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.retrieve("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -23376,7 +30846,7 @@ def test_tax_rates_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_rates.retrieve("txr_xxxxxxxxxxxxx") + client.v1.tax_rates.retrieve("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", @@ -23408,7 +30878,7 @@ async def test_tax_rates_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_rates.retrieve_async("txr_xxxxxxxxxxxxx") + await client.v1.tax_rates.retrieve_async("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", @@ -23416,6 +30886,35 @@ async def test_tax_rates_get_2_service_async( api_base="https://api.stripe.com", ) + def test_tax_rates_post_service_non_namespaced( + 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", + ) + def test_tax_rates_post(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.create( display_name="VAT", @@ -23443,7 +30942,7 @@ def test_tax_rates_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_rates.create( + client.v1.tax_rates.create( { "display_name": "VAT", "description": "VAT Germany", @@ -23491,7 +30990,7 @@ async def test_tax_rates_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_rates.create_async( + await client.v1.tax_rates.create_async( { "display_name": "VAT", "description": "VAT Germany", @@ -23508,6 +31007,30 @@ async def test_tax_rates_post_service_async( post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=false", ) + def test_tax_rates_post_2_service_non_namespaced( + 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", + ) + def test_tax_rates_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.modify( "txr_xxxxxxxxxxxxx", @@ -23532,7 +31055,7 @@ def test_tax_rates_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax_rates.update( + client.v1.tax_rates.update( "txr_xxxxxxxxxxxxx", {"active": False}, ) @@ -23572,7 +31095,7 @@ async def test_tax_rates_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax_rates.update_async( + await client.v1.tax_rates.update_async( "txr_xxxxxxxxxxxxx", {"active": False}, ) @@ -23584,6 +31107,27 @@ async def test_tax_rates_post_2_service_async( post_data="active=false", ) + def test_tax_registrations_get_service_non_namespaced( + 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", + ) + def test_tax_registrations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -23607,7 +31151,7 @@ def test_tax_registrations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax.registrations.list({"status": "all"}) + client.v1.tax.registrations.list({"status": "all"}) http_client_mock.assert_requested( "get", path="/v1/tax/registrations", @@ -23640,7 +31184,7 @@ async def test_tax_registrations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax.registrations.list_async({"status": "all"}) + await client.v1.tax.registrations.list_async({"status": "all"}) http_client_mock.assert_requested( "get", path="/v1/tax/registrations", @@ -23648,6 +31192,33 @@ async def test_tax_registrations_get_service_async( api_base="https://api.stripe.com", ) + def test_tax_registrations_post_service_non_namespaced( + 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", + ) + def test_tax_registrations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -23675,7 +31246,7 @@ def test_tax_registrations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax.registrations.create( + client.v1.tax.registrations.create( { "country": "IE", "country_options": {"ie": {"type": "oss_union"}}, @@ -23719,7 +31290,7 @@ async def test_tax_registrations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax.registrations.create_async( + await client.v1.tax.registrations.create_async( { "country": "IE", "country_options": {"ie": {"type": "oss_union"}}, @@ -23734,6 +31305,30 @@ async def test_tax_registrations_post_service_async( post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", ) + def test_tax_registrations_post_2_service_non_namespaced( + 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", + ) + def test_tax_registrations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -23760,7 +31355,7 @@ def test_tax_registrations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax.registrations.update( + client.v1.tax.registrations.update( "taxreg_xxxxxxxxxxxxx", {"expires_at": "now"}, ) @@ -23800,7 +31395,7 @@ async def test_tax_registrations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax.registrations.update_async( + await client.v1.tax.registrations.update_async( "taxreg_xxxxxxxxxxxxx", {"expires_at": "now"}, ) @@ -23812,6 +31407,26 @@ async def test_tax_registrations_post_2_service_async( post_data="expires_at=now", ) + def test_tax_settings_get_service_non_namespaced( + 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", + ) + def test_tax_settings_get(self, http_client_mock: HTTPClientMock) -> None: stripe.tax.Settings.retrieve() http_client_mock.assert_requested( @@ -23832,7 +31447,7 @@ def test_tax_settings_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax.settings.retrieve() + client.v1.tax.settings.retrieve() http_client_mock.assert_requested( "get", path="/v1/tax/settings", @@ -23864,7 +31479,7 @@ async def test_tax_settings_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax.settings.retrieve_async() + await client.v1.tax.settings.retrieve_async() http_client_mock.assert_requested( "get", path="/v1/tax/settings", @@ -23872,6 +31487,27 @@ async def test_tax_settings_get_service_async( api_base="https://api.stripe.com", ) + def test_tax_settings_post_service_non_namespaced( + 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", + ) + 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( @@ -23893,7 +31529,11 @@ def test_tax_settings_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax.settings.update({"defaults": {"tax_code": "txcd_10000000"}}) + client.v1.tax.settings.update( + { + "defaults": {"tax_code": "txcd_10000000"}, + } + ) http_client_mock.assert_requested( "post", path="/v1/tax/settings", @@ -23929,7 +31569,7 @@ async def test_tax_settings_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax.settings.update_async( + await client.v1.tax.settings.update_async( { "defaults": {"tax_code": "txcd_10000000"}, } @@ -23942,6 +31582,32 @@ async def test_tax_settings_post_service_async( post_data="defaults[tax_code]=txcd_10000000", ) + def test_tax_transactions_create_from_calculation_post_service_non_namespaced( + 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", + ) + def test_tax_transactions_create_from_calculation_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -23968,7 +31634,7 @@ def test_tax_transactions_create_from_calculation_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tax.transactions.create_from_calculation( + client.v1.tax.transactions.create_from_calculation( { "calculation": "xxx", "reference": "yyy", @@ -24010,7 +31676,7 @@ async def test_tax_transactions_create_from_calculation_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tax.transactions.create_from_calculation_async( + await client.v1.tax.transactions.create_from_calculation_async( { "calculation": "xxx", "reference": "yyy", @@ -24024,6 +31690,26 @@ async def test_tax_transactions_create_from_calculation_post_service_async( post_data="calculation=xxx&reference=yyy", ) + def test_terminal_configurations_delete_service_non_namespaced( + 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", + ) + def test_terminal_configurations_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -24046,7 +31732,7 @@ def test_terminal_configurations_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.delete("uc_123") + client.v1.terminal.configurations.delete("uc_123") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/uc_123", @@ -24078,7 +31764,7 @@ async def test_terminal_configurations_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.delete_async("uc_123") + await client.v1.terminal.configurations.delete_async("uc_123") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/uc_123", @@ -24086,6 +31772,26 @@ async def test_terminal_configurations_delete_service_async( api_base="https://api.stripe.com", ) + def test_terminal_configurations_delete_2_service_non_namespaced( + 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", + ) + def test_terminal_configurations_delete_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -24108,7 +31814,7 @@ def test_terminal_configurations_delete_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.delete("tmc_xxxxxxxxxxxxx") + client.v1.terminal.configurations.delete("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", @@ -24140,7 +31846,9 @@ async def test_terminal_configurations_delete_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.delete_async("tmc_xxxxxxxxxxxxx") + await client.v1.terminal.configurations.delete_async( + "tmc_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", @@ -24148,6 +31856,26 @@ async def test_terminal_configurations_delete_2_service_async( api_base="https://api.stripe.com", ) + def test_terminal_configurations_get_service_non_namespaced( + 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", + ) + def test_terminal_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -24170,7 +31898,7 @@ def test_terminal_configurations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.list() + client.v1.terminal.configurations.list() http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", @@ -24202,7 +31930,7 @@ async def test_terminal_configurations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.list_async() + await client.v1.terminal.configurations.list_async() http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", @@ -24210,6 +31938,26 @@ async def test_terminal_configurations_get_service_async( api_base="https://api.stripe.com", ) + def test_terminal_configurations_get_2_service_non_namespaced( + 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", + ) + def test_terminal_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -24232,7 +31980,7 @@ def test_terminal_configurations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.retrieve("uc_123") + client.v1.terminal.configurations.retrieve("uc_123") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/uc_123", @@ -24264,7 +32012,7 @@ async def test_terminal_configurations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.retrieve_async("uc_123") + await client.v1.terminal.configurations.retrieve_async("uc_123") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/uc_123", @@ -24272,6 +32020,27 @@ async def test_terminal_configurations_get_2_service_async( api_base="https://api.stripe.com", ) + def test_terminal_configurations_get_3_service_non_namespaced( + 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", + ) + def test_terminal_configurations_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -24295,7 +32064,7 @@ def test_terminal_configurations_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.list({"limit": 3}) + client.v1.terminal.configurations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", @@ -24328,7 +32097,7 @@ async def test_terminal_configurations_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.list_async({"limit": 3}) + await client.v1.terminal.configurations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", @@ -24336,6 +32105,26 @@ async def test_terminal_configurations_get_3_service_async( api_base="https://api.stripe.com", ) + def test_terminal_configurations_get_4_service_non_namespaced( + 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", + ) + def test_terminal_configurations_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -24358,7 +32147,7 @@ def test_terminal_configurations_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.retrieve("tmc_xxxxxxxxxxxxx") + client.v1.terminal.configurations.retrieve("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", @@ -24390,8 +32179,8 @@ async def test_terminal_configurations_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.retrieve_async( - "tmc_xxxxxxxxxxxxx" + await client.v1.terminal.configurations.retrieve_async( + "tmc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", @@ -24400,6 +32189,26 @@ async def test_terminal_configurations_get_4_service_async( api_base="https://api.stripe.com", ) + def test_terminal_configurations_post_service_non_namespaced( + 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", + ) + def test_terminal_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -24422,7 +32231,7 @@ def test_terminal_configurations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.create() + client.v1.terminal.configurations.create() http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", @@ -24454,7 +32263,7 @@ async def test_terminal_configurations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.create_async() + await client.v1.terminal.configurations.create_async() http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", @@ -24462,6 +32271,30 @@ async def test_terminal_configurations_post_service_async( api_base="https://api.stripe.com", ) + def test_terminal_configurations_post_2_service_non_namespaced( + 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", + ) + def test_terminal_configurations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -24488,7 +32321,7 @@ def test_terminal_configurations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.update( + client.v1.terminal.configurations.update( "uc_123", {"tipping": {"usd": {"fixed_amounts": [10]}}}, ) @@ -24528,7 +32361,7 @@ async def test_terminal_configurations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.update_async( + await client.v1.terminal.configurations.update_async( "uc_123", {"tipping": {"usd": {"fixed_amounts": [10]}}}, ) @@ -24540,6 +32373,31 @@ async def test_terminal_configurations_post_2_service_async( post_data="tipping[usd][fixed_amounts][0]=10", ) + def test_terminal_configurations_post_3_service_non_namespaced( + 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", + ) + def test_terminal_configurations_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -24565,7 +32423,7 @@ def test_terminal_configurations_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.create( + client.v1.terminal.configurations.create( { "bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}, } @@ -24605,7 +32463,7 @@ async def test_terminal_configurations_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.create_async( + await client.v1.terminal.configurations.create_async( { "bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}, } @@ -24618,6 +32476,30 @@ async def test_terminal_configurations_post_3_service_async( post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) + def test_terminal_configurations_post_4_service_non_namespaced( + 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", + ) + def test_terminal_configurations_post_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -24644,7 +32526,7 @@ def test_terminal_configurations_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.configurations.update( + client.v1.terminal.configurations.update( "tmc_xxxxxxxxxxxxx", {"bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}}, ) @@ -24684,7 +32566,7 @@ async def test_terminal_configurations_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.configurations.update_async( + await client.v1.terminal.configurations.update_async( "tmc_xxxxxxxxxxxxx", {"bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}}, ) @@ -24696,6 +32578,26 @@ async def test_terminal_configurations_post_4_service_async( post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) + def test_terminal_connection_tokens_post_service_non_namespaced( + 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", + ) + def test_terminal_connection_tokens_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -24718,7 +32620,7 @@ def test_terminal_connection_tokens_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.connection_tokens.create() + client.v1.terminal.connection_tokens.create() http_client_mock.assert_requested( "post", path="/v1/terminal/connection_tokens", @@ -24750,7 +32652,7 @@ async def test_terminal_connection_tokens_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.connection_tokens.create_async() + await client.v1.terminal.connection_tokens.create_async() http_client_mock.assert_requested( "post", path="/v1/terminal/connection_tokens", @@ -24758,6 +32660,26 @@ async def test_terminal_connection_tokens_post_service_async( api_base="https://api.stripe.com", ) + def test_terminal_locations_delete_service_non_namespaced( + 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", + ) + def test_terminal_locations_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -24780,7 +32702,7 @@ def test_terminal_locations_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.delete("tml_xxxxxxxxxxxxx") + client.v1.terminal.locations.delete("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", @@ -24812,7 +32734,7 @@ async def test_terminal_locations_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.locations.delete_async("tml_xxxxxxxxxxxxx") + await client.v1.terminal.locations.delete_async("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", @@ -24820,6 +32742,27 @@ async def test_terminal_locations_delete_service_async( api_base="https://api.stripe.com", ) + def test_terminal_locations_get_service_non_namespaced( + 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", + ) + def test_terminal_locations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -24843,7 +32786,7 @@ def test_terminal_locations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.list({"limit": 3}) + client.v1.terminal.locations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/locations", @@ -24876,7 +32819,7 @@ async def test_terminal_locations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.locations.list_async({"limit": 3}) + await client.v1.terminal.locations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/locations", @@ -24884,6 +32827,26 @@ async def test_terminal_locations_get_service_async( api_base="https://api.stripe.com", ) + def test_terminal_locations_get_2_service_non_namespaced( + 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", + ) + def test_terminal_locations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -24906,7 +32869,7 @@ def test_terminal_locations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.retrieve("tml_xxxxxxxxxxxxx") + client.v1.terminal.locations.retrieve("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", @@ -24938,7 +32901,7 @@ async def test_terminal_locations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.locations.retrieve_async("tml_xxxxxxxxxxxxx") + await client.v1.terminal.locations.retrieve_async("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", @@ -24946,6 +32909,38 @@ async def test_terminal_locations_get_2_service_async( api_base="https://api.stripe.com", ) + def test_terminal_locations_post_service_non_namespaced( + 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", + ) + def test_terminal_locations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -24978,7 +32973,7 @@ def test_terminal_locations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.create( + client.v1.terminal.locations.create( { "display_name": "My First Store", "address": { @@ -25032,7 +33027,7 @@ async def test_terminal_locations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.locations.create_async( + await client.v1.terminal.locations.create_async( { "display_name": "My First Store", "address": { @@ -25052,6 +33047,30 @@ async def test_terminal_locations_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_terminal_locations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -25078,7 +33097,7 @@ def test_terminal_locations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.locations.update( + client.v1.terminal.locations.update( "tml_xxxxxxxxxxxxx", {"display_name": "My First Store"}, ) @@ -25118,7 +33137,7 @@ async def test_terminal_locations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.locations.update_async( + await client.v1.terminal.locations.update_async( "tml_xxxxxxxxxxxxx", {"display_name": "My First Store"}, ) @@ -25130,6 +33149,26 @@ async def test_terminal_locations_post_2_service_async( post_data="display_name=My%20First%20Store", ) + def test_terminal_readers_cancel_action_post_service_non_namespaced( + 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", + ) + def test_terminal_readers_cancel_action_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -25152,7 +33191,7 @@ def test_terminal_readers_cancel_action_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.cancel_action("tmr_xxxxxxxxxxxxx") + client.v1.terminal.readers.cancel_action("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", @@ -25184,7 +33223,9 @@ async def test_terminal_readers_cancel_action_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.readers.cancel_action_async("tmr_xxxxxxxxxxxxx") + await client.v1.terminal.readers.cancel_action_async( + "tmr_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", @@ -25192,6 +33233,26 @@ async def test_terminal_readers_cancel_action_post_service_async( api_base="https://api.stripe.com", ) + def test_terminal_readers_delete_service_non_namespaced( + 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", + ) + def test_terminal_readers_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -25214,7 +33275,7 @@ def test_terminal_readers_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.delete("tmr_xxxxxxxxxxxxx") + client.v1.terminal.readers.delete("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", @@ -25246,7 +33307,7 @@ async def test_terminal_readers_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.readers.delete_async("tmr_xxxxxxxxxxxxx") + await client.v1.terminal.readers.delete_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", @@ -25254,6 +33315,27 @@ async def test_terminal_readers_delete_service_async( api_base="https://api.stripe.com", ) + def test_terminal_readers_get_service_non_namespaced( + 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", + ) + def test_terminal_readers_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -25277,7 +33359,7 @@ def test_terminal_readers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.list({"limit": 3}) + client.v1.terminal.readers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/readers", @@ -25310,7 +33392,7 @@ async def test_terminal_readers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.readers.list_async({"limit": 3}) + await client.v1.terminal.readers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/readers", @@ -25318,6 +33400,26 @@ async def test_terminal_readers_get_service_async( api_base="https://api.stripe.com", ) + def test_terminal_readers_get_2_service_non_namespaced( + 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", + ) + def test_terminal_readers_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -25340,7 +33442,7 @@ def test_terminal_readers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.retrieve("tmr_xxxxxxxxxxxxx") + client.v1.terminal.readers.retrieve("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", @@ -25372,7 +33474,7 @@ async def test_terminal_readers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.readers.retrieve_async("tmr_xxxxxxxxxxxxx") + await client.v1.terminal.readers.retrieve_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", @@ -25380,6 +33482,33 @@ async def test_terminal_readers_get_2_service_async( api_base="https://api.stripe.com", ) + def test_terminal_readers_post_service_non_namespaced( + 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", + ) + def test_terminal_readers_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -25407,7 +33536,7 @@ def test_terminal_readers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.create( + client.v1.terminal.readers.create( { "registration_code": "puppies-plug-could", "label": "Blue Rabbit", @@ -25451,7 +33580,7 @@ async def test_terminal_readers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.readers.create_async( + await client.v1.terminal.readers.create_async( { "registration_code": "puppies-plug-could", "label": "Blue Rabbit", @@ -25466,6 +33595,30 @@ async def test_terminal_readers_post_service_async( post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) + def test_terminal_readers_post_2_service_non_namespaced( + 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", + ) + def test_terminal_readers_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -25492,7 +33645,7 @@ def test_terminal_readers_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.update( + client.v1.terminal.readers.update( "tmr_xxxxxxxxxxxxx", {"label": "Blue Rabbit"}, ) @@ -25532,7 +33685,7 @@ async def test_terminal_readers_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.readers.update_async( + await client.v1.terminal.readers.update_async( "tmr_xxxxxxxxxxxxx", {"label": "Blue Rabbit"}, ) @@ -25544,6 +33697,30 @@ async def test_terminal_readers_post_2_service_async( post_data="label=Blue%20Rabbit", ) + def test_terminal_readers_process_payment_intent_post_service_non_namespaced( + 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", + ) + def test_terminal_readers_process_payment_intent_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -25570,7 +33747,7 @@ def test_terminal_readers_process_payment_intent_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.terminal.readers.process_payment_intent( + client.v1.terminal.readers.process_payment_intent( "tmr_xxxxxxxxxxxxx", {"payment_intent": "pi_xxxxxxxxxxxxx"}, ) @@ -25610,7 +33787,7 @@ async def test_terminal_readers_process_payment_intent_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.readers.process_payment_intent_async( + await client.v1.terminal.readers.process_payment_intent_async( "tmr_xxxxxxxxxxxxx", {"payment_intent": "pi_xxxxxxxxxxxxx"}, ) @@ -25622,22 +33799,7 @@ async def test_terminal_readers_process_payment_intent_post_service_async( 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", - allow_redisplay="always", - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", - query_string="", - post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", - ) - - def test_terminal_readers_process_setup_intent_post_service( + def test_terminal_readers_process_setup_intent_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -25664,11 +33826,10 @@ def test_terminal_readers_process_setup_intent_post_service( post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", ) - @pytest.mark.anyio - async def test_terminal_readers_process_setup_intent_post_async( + def test_terminal_readers_process_setup_intent_post( self, http_client_mock: HTTPClientMock ) -> None: - await stripe.terminal.Reader.process_setup_intent_async( + stripe.terminal.Reader.process_setup_intent( "tmr_xxxxxxxxxxxxx", setup_intent="seti_xxxxxxxxxxxxx", allow_redisplay="always", @@ -25680,8 +33841,7 @@ async def test_terminal_readers_process_setup_intent_post_async( post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", ) - @pytest.mark.anyio - async def test_terminal_readers_process_setup_intent_post_service_async( + def test_terminal_readers_process_setup_intent_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -25693,7 +33853,7 @@ async def test_terminal_readers_process_setup_intent_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.terminal.readers.process_setup_intent_async( + client.v1.terminal.readers.process_setup_intent( "tmr_xxxxxxxxxxxxx", { "setup_intent": "seti_xxxxxxxxxxxxx", @@ -25708,6 +33868,74 @@ async def test_terminal_readers_process_setup_intent_post_service_async( post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", ) + @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", + allow_redisplay="always", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", + ) + + @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.v1.terminal.readers.process_setup_intent_async( + "tmr_xxxxxxxxxxxxx", + { + "setup_intent": "seti_xxxxxxxxxxxxx", + "allow_redisplay": "always", + }, + ) + 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&allow_redisplay=always", + ) + + def test_test_helpers_customers_fund_cash_balance_post_service_non_namespaced( + 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", + ) + def test_test_helpers_customers_fund_cash_balance_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -25735,7 +33963,7 @@ def test_test_helpers_customers_fund_cash_balance_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.customers.fund_cash_balance( + client.v1.test_helpers.customers.fund_cash_balance( "cus_123", {"amount": 30, "currency": "eur"}, ) @@ -25776,7 +34004,7 @@ async def test_test_helpers_customers_fund_cash_balance_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.customers.fund_cash_balance_async( + await client.v1.test_helpers.customers.fund_cash_balance_async( "cus_123", {"amount": 30, "currency": "eur"}, ) @@ -25788,6 +34016,67 @@ async def test_test_helpers_customers_fund_cash_balance_post_service_async( post_data="amount=30¤cy=eur", ) + def test_test_helpers_issuing_authorizations_capture_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_authorizations_capture_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -25849,7 +34138,7 @@ def test_test_helpers_issuing_authorizations_capture_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.capture( + client.v1.test_helpers.issuing.authorizations.capture( "example_authorization", { "capture_amount": 100, @@ -25961,7 +34250,7 @@ async def test_test_helpers_issuing_authorizations_capture_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.authorizations.capture_async( + await client.v1.test_helpers.issuing.authorizations.capture_async( "example_authorization", { "capture_amount": 100, @@ -26010,6 +34299,28 @@ async def test_test_helpers_issuing_authorizations_capture_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_authorizations_expire_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26034,7 +34345,7 @@ def test_test_helpers_issuing_authorizations_expire_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.expire( + client.v1.test_helpers.issuing.authorizations.expire( "example_authorization", ) http_client_mock.assert_requested( @@ -26070,7 +34381,7 @@ async def test_test_helpers_issuing_authorizations_expire_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.authorizations.expire_async( + await client.v1.test_helpers.issuing.authorizations.expire_async( "example_authorization", ) http_client_mock.assert_requested( @@ -26080,6 +34391,30 @@ async def test_test_helpers_issuing_authorizations_expire_post_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_authorizations_increment_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_authorizations_increment_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26107,7 +34442,7 @@ def test_test_helpers_issuing_authorizations_increment_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.increment( + client.v1.test_helpers.issuing.authorizations.increment( "example_authorization", {"increment_amount": 50, "is_amount_controllable": True}, ) @@ -26148,7 +34483,7 @@ async def test_test_helpers_issuing_authorizations_increment_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.authorizations.increment_async( + await client.v1.test_helpers.issuing.authorizations.increment_async( "example_authorization", {"increment_amount": 50, "is_amount_controllable": True}, ) @@ -26160,6 +34495,54 @@ async def test_test_helpers_issuing_authorizations_increment_post_service_async( post_data="increment_amount=50&is_amount_controllable=true", ) + def test_test_helpers_issuing_authorizations_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_authorizations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26208,7 +34591,7 @@ def test_test_helpers_issuing_authorizations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.create( + client.v1.test_helpers.issuing.authorizations.create( { "amount": 100, "amount_details": {"atm_fee": 10, "cashback_amount": 5}, @@ -26294,7 +34677,7 @@ async def test_test_helpers_issuing_authorizations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.authorizations.create_async( + await client.v1.test_helpers.issuing.authorizations.create_async( { "amount": 100, "amount_details": {"atm_fee": 10, "cashback_amount": 5}, @@ -26330,6 +34713,30 @@ async def test_test_helpers_issuing_authorizations_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_authorizations_reverse_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26356,7 +34763,7 @@ def test_test_helpers_issuing_authorizations_reverse_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.authorizations.reverse( + client.v1.test_helpers.issuing.authorizations.reverse( "example_authorization", {"reverse_amount": 20}, ) @@ -26396,7 +34803,7 @@ async def test_test_helpers_issuing_authorizations_reverse_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.authorizations.reverse_async( + await client.v1.test_helpers.issuing.authorizations.reverse_async( "example_authorization", {"reverse_amount": 20}, ) @@ -26408,6 +34815,26 @@ async def test_test_helpers_issuing_authorizations_reverse_post_service_async( post_data="reverse_amount=20", ) + def test_test_helpers_issuing_cards_shipping_deliver_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_cards_shipping_deliver_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26430,7 +34857,7 @@ def test_test_helpers_issuing_cards_shipping_deliver_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.cards.deliver_card("card_123") + client.v1.test_helpers.issuing.cards.deliver_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", @@ -26462,7 +34889,9 @@ async def test_test_helpers_issuing_cards_shipping_deliver_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.cards.deliver_card_async("card_123") + await client.v1.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", @@ -26470,6 +34899,26 @@ async def test_test_helpers_issuing_cards_shipping_deliver_post_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_cards_shipping_fail_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_cards_shipping_fail_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26492,7 +34941,7 @@ def test_test_helpers_issuing_cards_shipping_fail_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.cards.fail_card("card_123") + client.v1.test_helpers.issuing.cards.fail_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", @@ -26524,7 +34973,7 @@ async def test_test_helpers_issuing_cards_shipping_fail_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.cards.fail_card_async("card_123") + await client.v1.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", @@ -26532,6 +34981,26 @@ async def test_test_helpers_issuing_cards_shipping_fail_post_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_cards_shipping_return_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_cards_shipping_return_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26554,7 +35023,7 @@ def test_test_helpers_issuing_cards_shipping_return_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.cards.return_card("card_123") + client.v1.test_helpers.issuing.cards.return_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/return", @@ -26586,7 +35055,9 @@ async def test_test_helpers_issuing_cards_shipping_return_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.cards.return_card_async("card_123") + await client.v1.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", @@ -26594,6 +35065,26 @@ async def test_test_helpers_issuing_cards_shipping_return_post_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_cards_shipping_ship_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_cards_shipping_ship_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26616,7 +35107,7 @@ def test_test_helpers_issuing_cards_shipping_ship_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.cards.ship_card("card_123") + client.v1.test_helpers.issuing.cards.ship_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", @@ -26648,7 +35139,7 @@ async def test_test_helpers_issuing_cards_shipping_ship_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.cards.ship_card_async("card_123") + await client.v1.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", @@ -26656,6 +35147,26 @@ async def test_test_helpers_issuing_cards_shipping_ship_post_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_personalization_designs_activate_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_personalization_designs_activate_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26678,7 +35189,9 @@ def test_test_helpers_issuing_personalization_designs_activate_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.personalization_designs.activate("pd_xyz") + client.v1.test_helpers.issuing.personalization_designs.activate( + "pd_xyz", + ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", @@ -26712,10 +35225,8 @@ async def test_test_helpers_issuing_personalization_designs_activate_post_servic http_client=http_client_mock.get_mock_http_client(), ) - await ( - client.test_helpers.issuing.personalization_designs.activate_async( - "pd_xyz" - ) + await client.v1.test_helpers.issuing.personalization_designs.activate_async( + "pd_xyz" ) http_client_mock.assert_requested( "post", @@ -26724,6 +35235,28 @@ async def test_test_helpers_issuing_personalization_designs_activate_post_servic api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_personalization_designs_deactivate_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_personalization_designs_deactivate_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26746,8 +35279,8 @@ def test_test_helpers_issuing_personalization_designs_deactivate_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.personalization_designs.deactivate( - "pd_xyz" + client.v1.test_helpers.issuing.personalization_designs.deactivate( + "pd_xyz", ) http_client_mock.assert_requested( "post", @@ -26784,7 +35317,7 @@ async def test_test_helpers_issuing_personalization_designs_deactivate_post_serv http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.personalization_designs.deactivate_async( + await client.v1.test_helpers.issuing.personalization_designs.deactivate_async( "pd_xyz" ) http_client_mock.assert_requested( @@ -26794,6 +35327,30 @@ async def test_test_helpers_issuing_personalization_designs_deactivate_post_serv api_base="https://api.stripe.com", ) + def test_test_helpers_issuing_personalization_designs_reject_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_personalization_designs_reject_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26820,7 +35377,7 @@ def test_test_helpers_issuing_personalization_designs_reject_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.personalization_designs.reject( + client.v1.test_helpers.issuing.personalization_designs.reject( "pd_xyz", {"rejection_reasons": {"card_logo": ["geographic_location"]}}, ) @@ -26860,7 +35417,7 @@ async def test_test_helpers_issuing_personalization_designs_reject_post_service_ http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.personalization_designs.reject_async( + await client.v1.test_helpers.issuing.personalization_designs.reject_async( "pd_xyz", {"rejection_reasons": {"card_logo": ["geographic_location"]}}, ) @@ -26872,6 +35429,77 @@ async def test_test_helpers_issuing_personalization_designs_reject_post_service_ post_data="rejection_reasons[card_logo][0]=geographic_location", ) + def test_test_helpers_issuing_transactions_create_force_capture_post_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_transactions_create_force_capture_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26943,7 +35571,7 @@ def test_test_helpers_issuing_transactions_create_force_capture_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.transactions.create_force_capture( + client.v1.test_helpers.issuing.transactions.create_force_capture( { "amount": 100, "card": "foo", @@ -27077,7 +35705,7 @@ async def test_test_helpers_issuing_transactions_create_force_capture_post_servi http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.transactions.create_force_capture_async( + await client.v1.test_helpers.issuing.transactions.create_force_capture_async( { "amount": 100, "card": "foo", @@ -27136,66 +35764,7 @@ async def test_test_helpers_issuing_transactions_create_force_capture_post_servi 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( + def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service_non_namespaced( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -27266,6 +35835,136 @@ def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service( 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( + 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.v1.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 @@ -27339,7 +36038,7 @@ async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_ser http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.transactions.create_unlinked_refund_async( + await client.v1.test_helpers.issuing.transactions.create_unlinked_refund_async( { "amount": 100, "card": "foo", @@ -27398,6 +36097,30 @@ async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_ser 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_service_non_namespaced( + 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", + ) + def test_test_helpers_issuing_transactions_refund_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -27424,7 +36147,7 @@ def test_test_helpers_issuing_transactions_refund_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.issuing.transactions.refund( + client.v1.test_helpers.issuing.transactions.refund( "example_transaction", {"refund_amount": 50}, ) @@ -27464,7 +36187,7 @@ async def test_test_helpers_issuing_transactions_refund_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.issuing.transactions.refund_async( + await client.v1.test_helpers.issuing.transactions.refund_async( "example_transaction", {"refund_amount": 50}, ) @@ -27476,6 +36199,26 @@ async def test_test_helpers_issuing_transactions_refund_post_service_async( post_data="refund_amount=50", ) + def test_test_helpers_refunds_expire_post_service_non_namespaced( + 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", + ) + def test_test_helpers_refunds_expire_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -27498,7 +36241,7 @@ def test_test_helpers_refunds_expire_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.refunds.expire("re_123") + client.v1.test_helpers.refunds.expire("re_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/refunds/re_123/expire", @@ -27530,7 +36273,7 @@ async def test_test_helpers_refunds_expire_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.refunds.expire_async("re_123") + await client.v1.test_helpers.refunds.expire_async("re_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/refunds/re_123/expire", @@ -27538,6 +36281,30 @@ async def test_test_helpers_refunds_expire_post_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_advance_post_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_advance_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -27564,7 +36331,7 @@ def test_test_helpers_test_clocks_advance_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.advance( + client.v1.test_helpers.test_clocks.advance( "clock_xyz", {"frozen_time": 142}, ) @@ -27604,7 +36371,7 @@ async def test_test_helpers_test_clocks_advance_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.advance_async( + await client.v1.test_helpers.test_clocks.advance_async( "clock_xyz", {"frozen_time": 142}, ) @@ -27616,6 +36383,30 @@ async def test_test_helpers_test_clocks_advance_post_service_async( post_data="frozen_time=142", ) + def test_test_helpers_test_clocks_advance_post_2_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_advance_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -27642,7 +36433,7 @@ def test_test_helpers_test_clocks_advance_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.advance( + client.v1.test_helpers.test_clocks.advance( "clock_xxxxxxxxxxxxx", {"frozen_time": 1675552261}, ) @@ -27682,7 +36473,7 @@ async def test_test_helpers_test_clocks_advance_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.advance_async( + await client.v1.test_helpers.test_clocks.advance_async( "clock_xxxxxxxxxxxxx", {"frozen_time": 1675552261}, ) @@ -27694,6 +36485,26 @@ async def test_test_helpers_test_clocks_advance_post_2_service_async( post_data="frozen_time=1675552261", ) + def test_test_helpers_test_clocks_delete_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -27716,7 +36527,7 @@ def test_test_helpers_test_clocks_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.delete("clock_xyz") + client.v1.test_helpers.test_clocks.delete("clock_xyz") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xyz", @@ -27748,7 +36559,7 @@ async def test_test_helpers_test_clocks_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.delete_async("clock_xyz") + await client.v1.test_helpers.test_clocks.delete_async("clock_xyz") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xyz", @@ -27756,6 +36567,26 @@ async def test_test_helpers_test_clocks_delete_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_delete_2_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_delete_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -27778,7 +36609,7 @@ def test_test_helpers_test_clocks_delete_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.delete("clock_xxxxxxxxxxxxx") + client.v1.test_helpers.test_clocks.delete("clock_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", @@ -27810,7 +36641,7 @@ async def test_test_helpers_test_clocks_delete_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.delete_async( + await client.v1.test_helpers.test_clocks.delete_async( "clock_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -27820,6 +36651,26 @@ async def test_test_helpers_test_clocks_delete_2_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_get_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -27842,7 +36693,7 @@ def test_test_helpers_test_clocks_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.list() + client.v1.test_helpers.test_clocks.list() http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", @@ -27874,7 +36725,7 @@ async def test_test_helpers_test_clocks_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.list_async() + await client.v1.test_helpers.test_clocks.list_async() http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", @@ -27882,6 +36733,26 @@ async def test_test_helpers_test_clocks_get_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_get_2_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -27904,7 +36775,7 @@ def test_test_helpers_test_clocks_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.retrieve("clock_xyz") + client.v1.test_helpers.test_clocks.retrieve("clock_xyz") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xyz", @@ -27936,7 +36807,7 @@ async def test_test_helpers_test_clocks_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.retrieve_async("clock_xyz") + await client.v1.test_helpers.test_clocks.retrieve_async("clock_xyz") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xyz", @@ -27944,6 +36815,27 @@ async def test_test_helpers_test_clocks_get_2_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_get_3_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -27967,7 +36859,7 @@ def test_test_helpers_test_clocks_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.list({"limit": 3}) + client.v1.test_helpers.test_clocks.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", @@ -28000,7 +36892,7 @@ async def test_test_helpers_test_clocks_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.list_async({"limit": 3}) + await client.v1.test_helpers.test_clocks.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", @@ -28008,6 +36900,26 @@ async def test_test_helpers_test_clocks_get_3_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_get_4_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -28030,7 +36942,7 @@ def test_test_helpers_test_clocks_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.retrieve("clock_xxxxxxxxxxxxx") + client.v1.test_helpers.test_clocks.retrieve("clock_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", @@ -28064,7 +36976,7 @@ async def test_test_helpers_test_clocks_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.retrieve_async( + await client.v1.test_helpers.test_clocks.retrieve_async( "clock_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -28074,6 +36986,32 @@ async def test_test_helpers_test_clocks_get_4_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_test_clocks_post_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28100,7 +37038,7 @@ def test_test_helpers_test_clocks_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.create( + client.v1.test_helpers.test_clocks.create( { "frozen_time": 123, "name": "cogsworth", @@ -28142,7 +37080,7 @@ async def test_test_helpers_test_clocks_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.create_async( + await client.v1.test_helpers.test_clocks.create_async( { "frozen_time": 123, "name": "cogsworth", @@ -28156,6 +37094,27 @@ async def test_test_helpers_test_clocks_post_service_async( post_data="frozen_time=123&name=cogsworth", ) + def test_test_helpers_test_clocks_post_2_service_non_namespaced( + 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", + ) + def test_test_helpers_test_clocks_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -28179,7 +37138,7 @@ def test_test_helpers_test_clocks_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.test_clocks.create({"frozen_time": 1577836800}) + client.v1.test_helpers.test_clocks.create({"frozen_time": 1577836800}) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", @@ -28215,7 +37174,7 @@ async def test_test_helpers_test_clocks_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.test_clocks.create_async( + await client.v1.test_helpers.test_clocks.create_async( { "frozen_time": 1577836800, } @@ -28228,6 +37187,30 @@ async def test_test_helpers_test_clocks_post_2_service_async( post_data="frozen_time=1577836800", ) + def test_test_helpers_treasury_inbound_transfers_fail_post_service_non_namespaced( + 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", + ) + def test_test_helpers_treasury_inbound_transfers_fail_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28254,7 +37237,7 @@ def test_test_helpers_treasury_inbound_transfers_fail_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.inbound_transfers.fail( + client.v1.test_helpers.treasury.inbound_transfers.fail( "ibt_123", {"failure_details": {"code": "account_closed"}}, ) @@ -28294,7 +37277,7 @@ async def test_test_helpers_treasury_inbound_transfers_fail_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.treasury.inbound_transfers.fail_async( + await client.v1.test_helpers.treasury.inbound_transfers.fail_async( "ibt_123", {"failure_details": {"code": "account_closed"}}, ) @@ -28306,6 +37289,28 @@ async def test_test_helpers_treasury_inbound_transfers_fail_post_service_async( post_data="failure_details[code]=account_closed", ) + def test_test_helpers_treasury_inbound_transfers_return_post_service_non_namespaced( + 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", + ) + def test_test_helpers_treasury_inbound_transfers_return_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28330,8 +37335,8 @@ def test_test_helpers_treasury_inbound_transfers_return_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.inbound_transfers.return_inbound_transfer( - "ibt_123", + client.v1.test_helpers.treasury.inbound_transfers.return_inbound_transfer( + "ibt_123" ) http_client_mock.assert_requested( "post", @@ -28366,7 +37371,7 @@ async def test_test_helpers_treasury_inbound_transfers_return_post_service_async http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.treasury.inbound_transfers.return_inbound_transfer_async( + await client.v1.test_helpers.treasury.inbound_transfers.return_inbound_transfer_async( "ibt_123" ) http_client_mock.assert_requested( @@ -28376,6 +37381,26 @@ async def test_test_helpers_treasury_inbound_transfers_return_post_service_async api_base="https://api.stripe.com", ) + def test_test_helpers_treasury_inbound_transfers_succeed_post_service_non_namespaced( + 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", + ) + def test_test_helpers_treasury_inbound_transfers_succeed_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28398,7 +37423,7 @@ def test_test_helpers_treasury_inbound_transfers_succeed_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.inbound_transfers.succeed("ibt_123") + client.v1.test_helpers.treasury.inbound_transfers.succeed("ibt_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", @@ -28432,7 +37457,7 @@ async def test_test_helpers_treasury_inbound_transfers_succeed_post_service_asyn http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.treasury.inbound_transfers.succeed_async( + await client.v1.test_helpers.treasury.inbound_transfers.succeed_async( "ibt_123", ) http_client_mock.assert_requested( @@ -28442,6 +37467,26 @@ async def test_test_helpers_treasury_inbound_transfers_succeed_post_service_asyn api_base="https://api.stripe.com", ) + def test_test_helpers_treasury_outbound_transfers_fail_post_service_non_namespaced( + 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", + ) + def test_test_helpers_treasury_outbound_transfers_fail_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28464,7 +37509,7 @@ def test_test_helpers_treasury_outbound_transfers_fail_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.outbound_transfers.fail("obt_123") + client.v1.test_helpers.treasury.outbound_transfers.fail("obt_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", @@ -28498,7 +37543,7 @@ async def test_test_helpers_treasury_outbound_transfers_fail_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.treasury.outbound_transfers.fail_async( + await client.v1.test_helpers.treasury.outbound_transfers.fail_async( "obt_123", ) http_client_mock.assert_requested( @@ -28508,6 +37553,26 @@ async def test_test_helpers_treasury_outbound_transfers_fail_post_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_treasury_outbound_transfers_post_post_service_non_namespaced( + 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", + ) + def test_test_helpers_treasury_outbound_transfers_post_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28530,7 +37595,7 @@ def test_test_helpers_treasury_outbound_transfers_post_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.outbound_transfers.post("obt_123") + client.v1.test_helpers.treasury.outbound_transfers.post("obt_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", @@ -28564,7 +37629,7 @@ async def test_test_helpers_treasury_outbound_transfers_post_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.treasury.outbound_transfers.post_async( + await client.v1.test_helpers.treasury.outbound_transfers.post_async( "obt_123", ) http_client_mock.assert_requested( @@ -28574,6 +37639,30 @@ async def test_test_helpers_treasury_outbound_transfers_post_post_service_async( api_base="https://api.stripe.com", ) + def test_test_helpers_treasury_outbound_transfers_return_post_service_non_namespaced( + 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", + ) + def test_test_helpers_treasury_outbound_transfers_return_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28600,7 +37689,7 @@ def test_test_helpers_treasury_outbound_transfers_return_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.outbound_transfers.return_outbound_transfer( + client.v1.test_helpers.treasury.outbound_transfers.return_outbound_transfer( "obt_123", {"returned_details": {"code": "account_closed"}}, ) @@ -28640,7 +37729,7 @@ async def test_test_helpers_treasury_outbound_transfers_return_post_service_asyn http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.treasury.outbound_transfers.return_outbound_transfer_async( + await client.v1.test_helpers.treasury.outbound_transfers.return_outbound_transfer_async( "obt_123", {"returned_details": {"code": "account_closed"}}, ) @@ -28652,6 +37741,34 @@ async def test_test_helpers_treasury_outbound_transfers_return_post_service_asyn post_data="returned_details[code]=account_closed", ) + def test_test_helpers_treasury_received_credits_post_service_non_namespaced( + 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", + ) + def test_test_helpers_treasury_received_credits_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28680,7 +37797,7 @@ def test_test_helpers_treasury_received_credits_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.received_credits.create( + client.v1.test_helpers.treasury.received_credits.create( { "financial_account": "fa_123", "network": "ach", @@ -28726,7 +37843,7 @@ async def test_test_helpers_treasury_received_credits_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.treasury.received_credits.create_async( + await client.v1.test_helpers.treasury.received_credits.create_async( { "financial_account": "fa_123", "network": "ach", @@ -28742,6 +37859,34 @@ async def test_test_helpers_treasury_received_credits_post_service_async( post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) + def test_test_helpers_treasury_received_debits_post_service_non_namespaced( + 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", + ) + def test_test_helpers_treasury_received_debits_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28770,7 +37915,7 @@ def test_test_helpers_treasury_received_debits_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.test_helpers.treasury.received_debits.create( + client.v1.test_helpers.treasury.received_debits.create( { "financial_account": "fa_123", "network": "ach", @@ -28816,7 +37961,7 @@ async def test_test_helpers_treasury_received_debits_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.test_helpers.treasury.received_debits.create_async( + await client.v1.test_helpers.treasury.received_debits.create_async( { "financial_account": "fa_123", "network": "ach", @@ -28832,6 +37977,26 @@ async def test_test_helpers_treasury_received_debits_post_service_async( post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) + def test_tokens_get_service_non_namespaced( + 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", + ) + def test_tokens_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.retrieve("tok_xxxx") http_client_mock.assert_requested( @@ -28852,7 +38017,7 @@ def test_tokens_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.retrieve("tok_xxxx") + client.v1.tokens.retrieve("tok_xxxx") http_client_mock.assert_requested( "get", path="/v1/tokens/tok_xxxx", @@ -28884,7 +38049,7 @@ async def test_tokens_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tokens.retrieve_async("tok_xxxx") + await client.v1.tokens.retrieve_async("tok_xxxx") http_client_mock.assert_requested( "get", path="/v1/tokens/tok_xxxx", @@ -28892,6 +38057,36 @@ async def test_tokens_get_service_async( api_base="https://api.stripe.com", ) + def test_tokens_post_service_non_namespaced( + 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", + ) + def test_tokens_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( card={ @@ -28920,7 +38115,7 @@ def test_tokens_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create( + client.v1.tokens.create( { "card": { "number": "4242424242424242", @@ -28970,7 +38165,7 @@ async def test_tokens_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tokens.create_async( + await client.v1.tokens.create_async( { "card": { "number": "4242424242424242", @@ -28988,6 +38183,38 @@ async def test_tokens_post_service_async( post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", ) + def test_tokens_post_2_service_non_namespaced( + 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", + ) + def test_tokens_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( bank_account={ @@ -29018,7 +38245,7 @@ def test_tokens_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create( + client.v1.tokens.create( { "bank_account": { "country": "US", @@ -29072,7 +38299,7 @@ async def test_tokens_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tokens.create_async( + await client.v1.tokens.create_async( { "bank_account": { "country": "US", @@ -29092,6 +38319,27 @@ async def test_tokens_post_2_service_async( 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_service_non_namespaced( + 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", + ) + def test_tokens_post_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create(pii={"id_number": "000000000"}) http_client_mock.assert_requested( @@ -29113,7 +38361,7 @@ def test_tokens_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create({"pii": {"id_number": "000000000"}}) + client.v1.tokens.create({"pii": {"id_number": "000000000"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", @@ -29147,7 +38395,9 @@ async def test_tokens_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tokens.create_async({"pii": {"id_number": "000000000"}}) + await client.v1.tokens.create_async( + {"pii": {"id_number": "000000000"}} + ) http_client_mock.assert_requested( "post", path="/v1/tokens", @@ -29156,6 +38406,34 @@ async def test_tokens_post_3_service_async( post_data="pii[id_number]=000000000", ) + def test_tokens_post_4_service_non_namespaced( + 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", + ) + def test_tokens_post_4(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( account={ @@ -29182,7 +38460,7 @@ def test_tokens_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create( + client.v1.tokens.create( { "account": { "individual": {"first_name": "Jane", "last_name": "Doe"}, @@ -29228,7 +38506,7 @@ async def test_tokens_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tokens.create_async( + await client.v1.tokens.create_async( { "account": { "individual": {"first_name": "Jane", "last_name": "Doe"}, @@ -29244,6 +38522,35 @@ async def test_tokens_post_4_service_async( post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=true", ) + def test_tokens_post_5_service_non_namespaced( + 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", + ) + def test_tokens_post_5(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( person={ @@ -29271,7 +38578,7 @@ def test_tokens_post_5_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create( + client.v1.tokens.create( { "person": { "first_name": "Jane", @@ -29319,7 +38626,7 @@ async def test_tokens_post_5_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tokens.create_async( + await client.v1.tokens.create_async( { "person": { "first_name": "Jane", @@ -29336,6 +38643,27 @@ async def test_tokens_post_5_service_async( post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=true", ) + def test_tokens_post_6_service_non_namespaced( + 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", + ) + def test_tokens_post_6(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create(cvc_update={"cvc": "123"}) http_client_mock.assert_requested( @@ -29357,7 +38685,7 @@ def test_tokens_post_6_service( http_client=http_client_mock.get_mock_http_client(), ) - client.tokens.create({"cvc_update": {"cvc": "123"}}) + client.v1.tokens.create({"cvc_update": {"cvc": "123"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", @@ -29391,7 +38719,7 @@ async def test_tokens_post_6_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.tokens.create_async({"cvc_update": {"cvc": "123"}}) + await client.v1.tokens.create_async({"cvc_update": {"cvc": "123"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", @@ -29400,6 +38728,26 @@ async def test_tokens_post_6_service_async( post_data="cvc_update[cvc]=123", ) + def test_topups_cancel_post_service_non_namespaced( + 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", + ) + def test_topups_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -29422,7 +38770,7 @@ def test_topups_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.topups.cancel("tu_xxxxxxxxxxxxx") + client.v1.topups.cancel("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", @@ -29454,7 +38802,7 @@ async def test_topups_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.topups.cancel_async("tu_xxxxxxxxxxxxx") + await client.v1.topups.cancel_async("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", @@ -29462,6 +38810,27 @@ async def test_topups_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_topups_get_service_non_namespaced( + 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", + ) + def test_topups_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.list(limit=3) http_client_mock.assert_requested( @@ -29483,7 +38852,7 @@ def test_topups_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.topups.list({"limit": 3}) + client.v1.topups.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/topups", @@ -29516,7 +38885,7 @@ async def test_topups_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.topups.list_async({"limit": 3}) + await client.v1.topups.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/topups", @@ -29524,6 +38893,26 @@ async def test_topups_get_service_async( api_base="https://api.stripe.com", ) + def test_topups_get_2_service_non_namespaced( + 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", + ) + def test_topups_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.retrieve("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -29544,7 +38933,7 @@ def test_topups_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.topups.retrieve("tu_xxxxxxxxxxxxx") + client.v1.topups.retrieve("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/topups/tu_xxxxxxxxxxxxx", @@ -29576,7 +38965,7 @@ async def test_topups_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.topups.retrieve_async("tu_xxxxxxxxxxxxx") + await client.v1.topups.retrieve_async("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/topups/tu_xxxxxxxxxxxxx", @@ -29584,6 +38973,34 @@ async def test_topups_get_2_service_async( api_base="https://api.stripe.com", ) + def test_topups_post_service_non_namespaced( + 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", + ) + def test_topups_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.create( amount=2000, @@ -29610,7 +39027,7 @@ def test_topups_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.topups.create( + client.v1.topups.create( { "amount": 2000, "currency": "usd", @@ -29656,7 +39073,7 @@ async def test_topups_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.topups.create_async( + await client.v1.topups.create_async( { "amount": 2000, "currency": "usd", @@ -29672,6 +39089,30 @@ async def test_topups_post_service_async( post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", ) + def test_topups_post_2_service_non_namespaced( + 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", + ) + def test_topups_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.modify( "tu_xxxxxxxxxxxxx", @@ -29696,7 +39137,7 @@ def test_topups_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.topups.update( + client.v1.topups.update( "tu_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -29736,7 +39177,7 @@ async def test_topups_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.topups.update_async( + await client.v1.topups.update_async( "tu_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -29748,6 +39189,27 @@ async def test_topups_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_transfers_get_service_non_namespaced( + 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", + ) + def test_transfers_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.list(limit=3) http_client_mock.assert_requested( @@ -29769,7 +39231,7 @@ def test_transfers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.list({"limit": 3}) + client.v1.transfers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/transfers", @@ -29802,7 +39264,7 @@ async def test_transfers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.transfers.list_async({"limit": 3}) + await client.v1.transfers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/transfers", @@ -29810,6 +39272,26 @@ async def test_transfers_get_service_async( api_base="https://api.stripe.com", ) + def test_transfers_get_2_service_non_namespaced( + 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", + ) + def test_transfers_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.retrieve("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -29830,7 +39312,7 @@ def test_transfers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.retrieve("tr_xxxxxxxxxxxxx") + client.v1.transfers.retrieve("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx", @@ -29862,7 +39344,7 @@ async def test_transfers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.transfers.retrieve_async("tr_xxxxxxxxxxxxx") + await client.v1.transfers.retrieve_async("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx", @@ -29870,6 +39352,34 @@ async def test_transfers_get_2_service_async( api_base="https://api.stripe.com", ) + def test_transfers_post_service_non_namespaced( + 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", + ) + def test_transfers_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.create( amount=400, @@ -29896,7 +39406,7 @@ def test_transfers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.create( + client.v1.transfers.create( { "amount": 400, "currency": "usd", @@ -29942,7 +39452,7 @@ async def test_transfers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.transfers.create_async( + await client.v1.transfers.create_async( { "amount": 400, "currency": "usd", @@ -29958,6 +39468,30 @@ async def test_transfers_post_service_async( post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) + def test_transfers_post_2_service_non_namespaced( + 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", + ) + def test_transfers_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.modify( "tr_xxxxxxxxxxxxx", @@ -29982,7 +39516,7 @@ def test_transfers_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.update( + client.v1.transfers.update( "tr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -30022,7 +39556,7 @@ async def test_transfers_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.transfers.update_async( + await client.v1.transfers.update_async( "tr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -30034,6 +39568,30 @@ async def test_transfers_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_transfers_reversals_get_service_non_namespaced( + 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", + ) + def test_transfers_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -30060,7 +39618,7 @@ def test_transfers_reversals_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.reversals.list( + client.v1.transfers.reversals.list( "tr_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -30099,7 +39657,7 @@ async def test_transfers_reversals_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.transfers.reversals.list_async( + await client.v1.transfers.reversals.list_async( "tr_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -30110,6 +39668,29 @@ async def test_transfers_reversals_get_service_async( api_base="https://api.stripe.com", ) + def test_transfers_reversals_get_2_service_non_namespaced( + 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", + ) + def test_transfers_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -30135,7 +39716,7 @@ def test_transfers_reversals_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.reversals.retrieve( + client.v1.transfers.reversals.retrieve( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", ) @@ -30173,7 +39754,7 @@ async def test_transfers_reversals_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.transfers.reversals.retrieve_async( + await client.v1.transfers.reversals.retrieve_async( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", ) @@ -30184,6 +39765,30 @@ async def test_transfers_reversals_get_2_service_async( api_base="https://api.stripe.com", ) + def test_transfers_reversals_post_service_non_namespaced( + 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", + ) + def test_transfers_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -30210,7 +39815,7 @@ def test_transfers_reversals_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.reversals.create( + client.v1.transfers.reversals.create( "tr_xxxxxxxxxxxxx", {"amount": 100}, ) @@ -30250,7 +39855,7 @@ async def test_transfers_reversals_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.transfers.reversals.create_async( + await client.v1.transfers.reversals.create_async( "tr_xxxxxxxxxxxxx", {"amount": 100}, ) @@ -30262,6 +39867,31 @@ async def test_transfers_reversals_post_service_async( post_data="amount=100", ) + def test_transfers_reversals_post_2_service_non_namespaced( + 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", + ) + def test_transfers_reversals_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -30289,7 +39919,7 @@ def test_transfers_reversals_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.transfers.reversals.update( + client.v1.transfers.reversals.update( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -30331,7 +39961,7 @@ async def test_transfers_reversals_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.transfers.reversals.update_async( + await client.v1.transfers.reversals.update_async( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -30344,6 +39974,32 @@ async def test_transfers_reversals_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_treasury_credit_reversals_get_service_non_namespaced( + 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", + ) + def test_treasury_credit_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -30370,7 +40026,7 @@ def test_treasury_credit_reversals_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.credit_reversals.list( + client.v1.treasury.credit_reversals.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -30411,7 +40067,7 @@ async def test_treasury_credit_reversals_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.credit_reversals.list_async( + await client.v1.treasury.credit_reversals.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -30424,6 +40080,26 @@ async def test_treasury_credit_reversals_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_credit_reversals_get_2_service_non_namespaced( + 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", + ) + def test_treasury_credit_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -30446,7 +40122,7 @@ def test_treasury_credit_reversals_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.credit_reversals.retrieve("credrev_xxxxxxxxxxxxx") + client.v1.treasury.credit_reversals.retrieve("credrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", @@ -30480,7 +40156,7 @@ async def test_treasury_credit_reversals_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.credit_reversals.retrieve_async( + await client.v1.treasury.credit_reversals.retrieve_async( "credrev_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -30490,6 +40166,31 @@ async def test_treasury_credit_reversals_get_2_service_async( api_base="https://api.stripe.com", ) + def test_treasury_credit_reversals_post_service_non_namespaced( + 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", + ) + def test_treasury_credit_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -30515,7 +40216,7 @@ def test_treasury_credit_reversals_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.credit_reversals.create( + client.v1.treasury.credit_reversals.create( { "received_credit": "rc_xxxxxxxxxxxxx", } @@ -30555,7 +40256,7 @@ async def test_treasury_credit_reversals_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.credit_reversals.create_async( + await client.v1.treasury.credit_reversals.create_async( { "received_credit": "rc_xxxxxxxxxxxxx", } @@ -30568,6 +40269,32 @@ async def test_treasury_credit_reversals_post_service_async( post_data="received_credit=rc_xxxxxxxxxxxxx", ) + def test_treasury_debit_reversals_get_service_non_namespaced( + 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", + ) + def test_treasury_debit_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -30594,7 +40321,7 @@ def test_treasury_debit_reversals_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.debit_reversals.list( + client.v1.treasury.debit_reversals.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -30635,7 +40362,7 @@ async def test_treasury_debit_reversals_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.debit_reversals.list_async( + await client.v1.treasury.debit_reversals.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -30648,6 +40375,26 @@ async def test_treasury_debit_reversals_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_debit_reversals_get_2_service_non_namespaced( + 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", + ) + def test_treasury_debit_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -30670,7 +40417,7 @@ def test_treasury_debit_reversals_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.debit_reversals.retrieve("debrev_xxxxxxxxxxxxx") + client.v1.treasury.debit_reversals.retrieve("debrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", @@ -30704,7 +40451,7 @@ async def test_treasury_debit_reversals_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.debit_reversals.retrieve_async( + await client.v1.treasury.debit_reversals.retrieve_async( "debrev_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -30714,6 +40461,31 @@ async def test_treasury_debit_reversals_get_2_service_async( api_base="https://api.stripe.com", ) + def test_treasury_debit_reversals_post_service_non_namespaced( + 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", + ) + def test_treasury_debit_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -30737,7 +40509,7 @@ def test_treasury_debit_reversals_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.debit_reversals.create( + client.v1.treasury.debit_reversals.create( { "received_debit": "rd_xxxxxxxxxxxxx", } @@ -30777,7 +40549,7 @@ async def test_treasury_debit_reversals_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.debit_reversals.create_async( + await client.v1.treasury.debit_reversals.create_async( { "received_debit": "rd_xxxxxxxxxxxxx", } @@ -30790,6 +40562,28 @@ async def test_treasury_debit_reversals_post_service_async( post_data="received_debit=rd_xxxxxxxxxxxxx", ) + def test_treasury_financial_accounts_features_get_service_non_namespaced( + 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", + ) + def test_treasury_financial_accounts_features_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -30812,8 +40606,8 @@ def test_treasury_financial_accounts_features_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.features.retrieve( - "fa_xxxxxxxxxxxxx" + client.v1.treasury.financial_accounts.features.retrieve( + "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", @@ -30848,7 +40642,7 @@ async def test_treasury_financial_accounts_features_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.financial_accounts.features.retrieve_async( + await client.v1.treasury.financial_accounts.features.retrieve_async( "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -30858,6 +40652,27 @@ async def test_treasury_financial_accounts_features_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_financial_accounts_get_service_non_namespaced( + 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", + ) + def test_treasury_financial_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -30881,7 +40696,7 @@ def test_treasury_financial_accounts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.list({"limit": 3}) + client.v1.treasury.financial_accounts.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts", @@ -30914,7 +40729,7 @@ async def test_treasury_financial_accounts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.financial_accounts.list_async({"limit": 3}) + await client.v1.treasury.financial_accounts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts", @@ -30922,6 +40737,26 @@ async def test_treasury_financial_accounts_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_financial_accounts_get_2_service_non_namespaced( + 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", + ) + def test_treasury_financial_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -30944,7 +40779,7 @@ def test_treasury_financial_accounts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.retrieve("fa_xxxxxxxxxxxxx") + client.v1.treasury.financial_accounts.retrieve("fa_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", @@ -30978,7 +40813,7 @@ async def test_treasury_financial_accounts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.financial_accounts.retrieve_async( + await client.v1.treasury.financial_accounts.retrieve_async( "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -30988,6 +40823,32 @@ async def test_treasury_financial_accounts_get_2_service_async( api_base="https://api.stripe.com", ) + def test_treasury_financial_accounts_post_service_non_namespaced( + 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", + ) + def test_treasury_financial_accounts_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -31014,7 +40875,7 @@ def test_treasury_financial_accounts_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.create( + client.v1.treasury.financial_accounts.create( { "supported_currencies": ["usd"], "features": {}, @@ -31056,7 +40917,7 @@ async def test_treasury_financial_accounts_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.financial_accounts.create_async( + await client.v1.treasury.financial_accounts.create_async( { "supported_currencies": ["usd"], "features": {}, @@ -31070,6 +40931,30 @@ async def test_treasury_financial_accounts_post_service_async( post_data="supported_currencies[0]=usd", ) + def test_treasury_financial_accounts_post_2_service_non_namespaced( + 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", + ) + def test_treasury_financial_accounts_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -31096,7 +40981,7 @@ def test_treasury_financial_accounts_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.financial_accounts.update( + client.v1.treasury.financial_accounts.update( "fa_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -31136,7 +41021,7 @@ async def test_treasury_financial_accounts_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.financial_accounts.update_async( + await client.v1.treasury.financial_accounts.update_async( "fa_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -31148,6 +41033,26 @@ async def test_treasury_financial_accounts_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_treasury_inbound_transfers_cancel_post_service_non_namespaced( + 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", + ) + def test_treasury_inbound_transfers_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -31170,7 +41075,7 @@ def test_treasury_inbound_transfers_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.inbound_transfers.cancel("ibt_xxxxxxxxxxxxx") + client.v1.treasury.inbound_transfers.cancel("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", @@ -31202,7 +41107,7 @@ async def test_treasury_inbound_transfers_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.inbound_transfers.cancel_async( + await client.v1.treasury.inbound_transfers.cancel_async( "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -31212,6 +41117,32 @@ async def test_treasury_inbound_transfers_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_treasury_inbound_transfers_get_service_non_namespaced( + 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", + ) + def test_treasury_inbound_transfers_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -31238,7 +41169,7 @@ def test_treasury_inbound_transfers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.inbound_transfers.list( + client.v1.treasury.inbound_transfers.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -31279,7 +41210,7 @@ async def test_treasury_inbound_transfers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.inbound_transfers.list_async( + await client.v1.treasury.inbound_transfers.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -31292,6 +41223,26 @@ async def test_treasury_inbound_transfers_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_inbound_transfers_get_2_service_non_namespaced( + 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", + ) + def test_treasury_inbound_transfers_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -31314,7 +41265,7 @@ def test_treasury_inbound_transfers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.inbound_transfers.retrieve("ibt_xxxxxxxxxxxxx") + client.v1.treasury.inbound_transfers.retrieve("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", @@ -31348,7 +41299,7 @@ async def test_treasury_inbound_transfers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.inbound_transfers.retrieve_async( + await client.v1.treasury.inbound_transfers.retrieve_async( "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -31358,6 +41309,35 @@ async def test_treasury_inbound_transfers_get_2_service_async( api_base="https://api.stripe.com", ) + def test_treasury_inbound_transfers_post_service_non_namespaced( + 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", + ) + def test_treasury_inbound_transfers_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -31387,7 +41367,7 @@ def test_treasury_inbound_transfers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.inbound_transfers.create( + client.v1.treasury.inbound_transfers.create( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, @@ -31435,7 +41415,7 @@ async def test_treasury_inbound_transfers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.inbound_transfers.create_async( + await client.v1.treasury.inbound_transfers.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, @@ -31452,6 +41432,26 @@ async def test_treasury_inbound_transfers_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_treasury_outbound_payments_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -31474,7 +41474,7 @@ def test_treasury_outbound_payments_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_payments.cancel("bot_xxxxxxxxxxxxx") + client.v1.treasury.outbound_payments.cancel("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", @@ -31506,7 +41506,7 @@ async def test_treasury_outbound_payments_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.outbound_payments.cancel_async( + await client.v1.treasury.outbound_payments.cancel_async( "bot_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -31516,6 +41516,32 @@ async def test_treasury_outbound_payments_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_treasury_outbound_payments_get_service_non_namespaced( + 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", + ) + def test_treasury_outbound_payments_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -31542,7 +41568,7 @@ def test_treasury_outbound_payments_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_payments.list( + client.v1.treasury.outbound_payments.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -31583,7 +41609,7 @@ async def test_treasury_outbound_payments_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.outbound_payments.list_async( + await client.v1.treasury.outbound_payments.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -31596,6 +41622,26 @@ async def test_treasury_outbound_payments_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_outbound_payments_get_2_service_non_namespaced( + 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", + ) + def test_treasury_outbound_payments_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -31618,7 +41664,7 @@ def test_treasury_outbound_payments_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_payments.retrieve("bot_xxxxxxxxxxxxx") + client.v1.treasury.outbound_payments.retrieve("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", @@ -31652,7 +41698,7 @@ async def test_treasury_outbound_payments_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.outbound_payments.retrieve_async( + await client.v1.treasury.outbound_payments.retrieve_async( "bot_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -31662,6 +41708,36 @@ async def test_treasury_outbound_payments_get_2_service_async( api_base="https://api.stripe.com", ) + def test_treasury_outbound_payments_post_service_non_namespaced( + 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", + ) + def test_treasury_outbound_payments_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -31692,7 +41768,7 @@ def test_treasury_outbound_payments_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_payments.create( + client.v1.treasury.outbound_payments.create( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, @@ -31742,7 +41818,7 @@ async def test_treasury_outbound_payments_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.outbound_payments.create_async( + await client.v1.treasury.outbound_payments.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, @@ -31760,6 +41836,26 @@ async def test_treasury_outbound_payments_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_treasury_outbound_transfers_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -31782,7 +41878,7 @@ def test_treasury_outbound_transfers_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_transfers.cancel("obt_xxxxxxxxxxxxx") + client.v1.treasury.outbound_transfers.cancel("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", @@ -31816,7 +41912,7 @@ async def test_treasury_outbound_transfers_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.outbound_transfers.cancel_async( + await client.v1.treasury.outbound_transfers.cancel_async( "obt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -31826,6 +41922,32 @@ async def test_treasury_outbound_transfers_cancel_post_service_async( api_base="https://api.stripe.com", ) + def test_treasury_outbound_transfers_get_service_non_namespaced( + 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", + ) + def test_treasury_outbound_transfers_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -31852,7 +41974,7 @@ def test_treasury_outbound_transfers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_transfers.list( + client.v1.treasury.outbound_transfers.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -31893,7 +42015,7 @@ async def test_treasury_outbound_transfers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.outbound_transfers.list_async( + await client.v1.treasury.outbound_transfers.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -31906,6 +42028,26 @@ async def test_treasury_outbound_transfers_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_outbound_transfers_get_2_service_non_namespaced( + 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", + ) + def test_treasury_outbound_transfers_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -31928,7 +42070,7 @@ def test_treasury_outbound_transfers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_transfers.retrieve("obt_xxxxxxxxxxxxx") + client.v1.treasury.outbound_transfers.retrieve("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", @@ -31962,7 +42104,7 @@ async def test_treasury_outbound_transfers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.outbound_transfers.retrieve_async( + await client.v1.treasury.outbound_transfers.retrieve_async( "obt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -31972,6 +42114,35 @@ async def test_treasury_outbound_transfers_get_2_service_async( api_base="https://api.stripe.com", ) + def test_treasury_outbound_transfers_post_service_non_namespaced( + 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", + ) + def test_treasury_outbound_transfers_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -32001,7 +42172,7 @@ def test_treasury_outbound_transfers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.outbound_transfers.create( + client.v1.treasury.outbound_transfers.create( { "financial_account": "fa_xxxxxxxxxxxxx", "destination_payment_method": "pm_xxxxxxxxxxxxx", @@ -32049,7 +42220,7 @@ async def test_treasury_outbound_transfers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.outbound_transfers.create_async( + await client.v1.treasury.outbound_transfers.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", "destination_payment_method": "pm_xxxxxxxxxxxxx", @@ -32066,6 +42237,32 @@ async def test_treasury_outbound_transfers_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_treasury_received_credits_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -32092,7 +42289,7 @@ def test_treasury_received_credits_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.received_credits.list( + client.v1.treasury.received_credits.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -32133,7 +42330,7 @@ async def test_treasury_received_credits_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.received_credits.list_async( + await client.v1.treasury.received_credits.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -32146,6 +42343,26 @@ async def test_treasury_received_credits_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_received_credits_get_2_service_non_namespaced( + 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", + ) + def test_treasury_received_credits_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -32168,7 +42385,7 @@ def test_treasury_received_credits_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.received_credits.retrieve("rc_xxxxxxxxxxxxx") + client.v1.treasury.received_credits.retrieve("rc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", @@ -32200,7 +42417,7 @@ async def test_treasury_received_credits_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.received_credits.retrieve_async( + await client.v1.treasury.received_credits.retrieve_async( "rc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -32210,6 +42427,32 @@ async def test_treasury_received_credits_get_2_service_async( api_base="https://api.stripe.com", ) + def test_treasury_received_debits_get_service_non_namespaced( + 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", + ) + def test_treasury_received_debits_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -32236,7 +42479,7 @@ def test_treasury_received_debits_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.received_debits.list( + client.v1.treasury.received_debits.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -32277,7 +42520,7 @@ async def test_treasury_received_debits_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.received_debits.list_async( + await client.v1.treasury.received_debits.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -32290,6 +42533,26 @@ async def test_treasury_received_debits_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_received_debits_get_2_service_non_namespaced( + 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", + ) + def test_treasury_received_debits_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -32312,7 +42575,7 @@ def test_treasury_received_debits_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.received_debits.retrieve("rd_xxxxxxxxxxxxx") + client.v1.treasury.received_debits.retrieve("rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", @@ -32344,8 +42607,8 @@ async def test_treasury_received_debits_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.received_debits.retrieve_async( - "rd_xxxxxxxxxxxxx" + await client.v1.treasury.received_debits.retrieve_async( + "rd_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", @@ -32354,6 +42617,32 @@ async def test_treasury_received_debits_get_2_service_async( api_base="https://api.stripe.com", ) + def test_treasury_transaction_entries_get_service_non_namespaced( + 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", + ) + def test_treasury_transaction_entries_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -32380,7 +42669,7 @@ def test_treasury_transaction_entries_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.transaction_entries.list( + client.v1.treasury.transaction_entries.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -32421,7 +42710,7 @@ async def test_treasury_transaction_entries_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.transaction_entries.list_async( + await client.v1.treasury.transaction_entries.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -32434,6 +42723,26 @@ async def test_treasury_transaction_entries_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_transaction_entries_get_2_service_non_namespaced( + 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", + ) + def test_treasury_transaction_entries_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -32456,7 +42765,7 @@ def test_treasury_transaction_entries_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.transaction_entries.retrieve("trxne_xxxxxxxxxxxxx") + client.v1.treasury.transaction_entries.retrieve("trxne_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", @@ -32490,7 +42799,7 @@ async def test_treasury_transaction_entries_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.transaction_entries.retrieve_async( + await client.v1.treasury.transaction_entries.retrieve_async( "trxne_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -32500,6 +42809,32 @@ async def test_treasury_transaction_entries_get_2_service_async( api_base="https://api.stripe.com", ) + def test_treasury_transactions_get_service_non_namespaced( + 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", + ) + def test_treasury_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -32526,7 +42861,7 @@ def test_treasury_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.transactions.list( + client.v1.treasury.transactions.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -32567,7 +42902,7 @@ async def test_treasury_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.transactions.list_async( + await client.v1.treasury.transactions.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -32580,6 +42915,26 @@ async def test_treasury_transactions_get_service_async( api_base="https://api.stripe.com", ) + def test_treasury_transactions_get_2_service_non_namespaced( + 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", + ) + def test_treasury_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -32602,7 +42957,7 @@ def test_treasury_transactions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.treasury.transactions.retrieve("trxn_xxxxxxxxxxxxx") + client.v1.treasury.transactions.retrieve("trxn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", @@ -32634,7 +42989,9 @@ async def test_treasury_transactions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.treasury.transactions.retrieve_async("trxn_xxxxxxxxxxxxx") + await client.v1.treasury.transactions.retrieve_async( + "trxn_xxxxxxxxxxxxx", + ) http_client_mock.assert_requested( "get", path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", @@ -32642,6 +42999,26 @@ async def test_treasury_transactions_get_2_service_async( api_base="https://api.stripe.com", ) + def test_webhook_endpoints_delete_service_non_namespaced( + 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", + ) + def test_webhook_endpoints_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -32664,7 +43041,7 @@ def test_webhook_endpoints_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.webhook_endpoints.delete("we_xxxxxxxxxxxxx") + client.v1.webhook_endpoints.delete("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", @@ -32696,7 +43073,7 @@ async def test_webhook_endpoints_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.webhook_endpoints.delete_async("we_xxxxxxxxxxxxx") + await client.v1.webhook_endpoints.delete_async("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", @@ -32704,6 +43081,27 @@ async def test_webhook_endpoints_delete_service_async( api_base="https://api.stripe.com", ) + def test_webhook_endpoints_get_service_non_namespaced( + 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", + ) + def test_webhook_endpoints_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -32727,7 +43125,7 @@ def test_webhook_endpoints_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.webhook_endpoints.list({"limit": 3}) + client.v1.webhook_endpoints.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints", @@ -32760,7 +43158,7 @@ async def test_webhook_endpoints_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.webhook_endpoints.list_async({"limit": 3}) + await client.v1.webhook_endpoints.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints", @@ -32768,6 +43166,26 @@ async def test_webhook_endpoints_get_service_async( api_base="https://api.stripe.com", ) + def test_webhook_endpoints_get_2_service_non_namespaced( + 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", + ) + def test_webhook_endpoints_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -32790,7 +43208,7 @@ def test_webhook_endpoints_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.webhook_endpoints.retrieve("we_xxxxxxxxxxxxx") + client.v1.webhook_endpoints.retrieve("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", @@ -32822,7 +43240,7 @@ async def test_webhook_endpoints_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.webhook_endpoints.retrieve_async("we_xxxxxxxxxxxxx") + await client.v1.webhook_endpoints.retrieve_async("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", @@ -32830,6 +43248,32 @@ async def test_webhook_endpoints_get_2_service_async( api_base="https://api.stripe.com", ) + def test_webhook_endpoints_post_service_non_namespaced( + 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", + ) + def test_webhook_endpoints_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -32856,7 +43300,7 @@ def test_webhook_endpoints_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.webhook_endpoints.create( + client.v1.webhook_endpoints.create( { "url": "https://example.com/my/webhook/endpoint", "enabled_events": ["charge.failed", "charge.succeeded"], @@ -32898,7 +43342,7 @@ async def test_webhook_endpoints_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.webhook_endpoints.create_async( + await client.v1.webhook_endpoints.create_async( { "url": "https://example.com/my/webhook/endpoint", "enabled_events": ["charge.failed", "charge.succeeded"], @@ -32912,6 +43356,30 @@ async def test_webhook_endpoints_post_service_async( 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_service_non_namespaced( + 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", + ) + def test_webhook_endpoints_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -32938,7 +43406,7 @@ def test_webhook_endpoints_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.webhook_endpoints.update( + client.v1.webhook_endpoints.update( "we_xxxxxxxxxxxxx", {"url": "https://example.com/new_endpoint"}, ) @@ -32978,7 +43446,7 @@ async def test_webhook_endpoints_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.webhook_endpoints.update_async( + await client.v1.webhook_endpoints.update_async( "we_xxxxxxxxxxxxx", {"url": "https://example.com/new_endpoint"}, ) From 54e57edc6b4806f58aec1a861fa0ff47b6526db4 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 13:28:47 +0000 Subject: [PATCH 2/8] Update generated code for v1789 and 2025-05-28.basil --- stripe/__init__.py | 1 - stripe/_stripe_client.py | 83 +- stripe/_v1_services.py | 160 - tests/test_generated_examples.py | 12964 +++-------------------------- 4 files changed, 1328 insertions(+), 11880 deletions(-) delete mode 100644 stripe/_v1_services.py diff --git a/stripe/__init__.py b/stripe/__init__.py index 4aea00eae..5b98fd411 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -567,7 +567,6 @@ def __getattr__(name): ) from stripe._transfer_service import TransferService as TransferService from stripe._treasury_service import TreasuryService as TreasuryService -from stripe._v1_services import V1Services as V1Services from stripe._v2_services import V2Services as V2Services from stripe._webhook_endpoint import WebhookEndpoint as WebhookEndpoint from stripe._webhook_endpoint_service import ( diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 2cb5ed60a..9d78728bf 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -35,8 +35,6 @@ from stripe._oauth_service import OAuthService # services: The beginning of the section generated from our OpenAPI spec -from stripe._v1_services import V1Services -from stripe._v2_services import V2Services from stripe._account_service import AccountService from stripe._account_link_service import AccountLinkService from stripe._account_session_service import AccountSessionService @@ -110,6 +108,7 @@ from stripe._transfer_service import TransferService from stripe._treasury_service import TreasuryService from stripe._webhook_endpoint_service import WebhookEndpointService +from stripe._v2_services import V2Services # services: The end of the section generated from our OpenAPI spec @@ -187,7 +186,85 @@ def __init__( self.oauth = OAuthService(self._requestor, self._options) # top-level services: The beginning of the section generated from our OpenAPI spec - self.v1 = V1Services(self._requestor) + 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_payments = InvoicePaymentService(self._requestor) + self.invoice_rendering_templates = InvoiceRenderingTemplateService( + 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) self.v2 = V2Services(self._requestor) # top-level services: The end of the section generated from our OpenAPI spec diff --git a/stripe/_v1_services.py b/stripe/_v1_services.py deleted file mode 100644 index 929125c90..000000000 --- a/stripe/_v1_services.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._account_link_service import AccountLinkService -from stripe._account_service import AccountService -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_portal_service import BillingPortalService -from stripe._billing_service import BillingService -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._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_link_service import FileLinkService -from stripe._file_service import FileService -from stripe._financial_connections_service import FinancialConnectionsService -from stripe._forwarding_service import ForwardingService -from stripe._identity_service import IdentityService -from stripe._invoice_item_service import InvoiceItemService -from stripe._invoice_payment_service import InvoicePaymentService -from stripe._invoice_rendering_template_service import ( - InvoiceRenderingTemplateService, -) -from stripe._invoice_service import InvoiceService -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_configuration_service import ( - PaymentMethodConfigurationService, -) -from stripe._payment_method_domain_service import PaymentMethodDomainService -from stripe._payment_method_service import PaymentMethodService -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._setup_attempt_service import SetupAttemptService -from stripe._setup_intent_service import SetupIntentService -from stripe._shipping_rate_service import ShippingRateService -from stripe._sigma_service import SigmaService -from stripe._source_service import SourceService -from stripe._stripe_service import StripeService -from stripe._subscription_item_service import SubscriptionItemService -from stripe._subscription_schedule_service import SubscriptionScheduleService -from stripe._subscription_service import SubscriptionService -from stripe._tax_code_service import TaxCodeService -from stripe._tax_id_service import TaxIdService -from stripe._tax_rate_service import TaxRateService -from stripe._tax_service import TaxService -from stripe._terminal_service import TerminalService -from stripe._test_helpers_service import TestHelpersService -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 - - -class V1Services(StripeService): - def __init__(self, requestor): - super().__init__(requestor) - 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_payments = InvoicePaymentService(self._requestor) - self.invoice_rendering_templates = InvoiceRenderingTemplateService( - 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) diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 42e192d91..90094e144 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -10,34 +10,6 @@ class TestGeneratedExamples(object): - def test_account_links_post_service_non_namespaced( - 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", - ) - def test_account_links_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -66,7 +38,7 @@ def test_account_links_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.account_links.create( + client.account_links.create( { "account": "acct_xxxxxxxxxxxxx", "refresh_url": "https://example.com/reauth", @@ -112,7 +84,7 @@ async def test_account_links_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.account_links.create_async( + await client.account_links.create_async( { "account": "acct_xxxxxxxxxxxxx", "refresh_url": "https://example.com/reauth", @@ -128,26 +100,6 @@ async def test_account_links_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_accounts_capabilities_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -170,7 +122,7 @@ def test_accounts_capabilities_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.capabilities.list("acct_xxxxxxxxxxxxx") + client.accounts.capabilities.list("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", @@ -202,7 +154,7 @@ async def test_accounts_capabilities_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.capabilities.list_async("acct_xxxxxxxxxxxxx") + await client.accounts.capabilities.list_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", @@ -210,29 +162,6 @@ async def test_accounts_capabilities_get_service_async( api_base="https://api.stripe.com", ) - def test_accounts_capabilities_get_2_service_non_namespaced( - 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", - ) - def test_accounts_capabilities_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -258,7 +187,7 @@ def test_accounts_capabilities_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.capabilities.retrieve( + client.accounts.capabilities.retrieve( "acct_xxxxxxxxxxxxx", "card_payments", ) @@ -296,7 +225,7 @@ async def test_accounts_capabilities_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.capabilities.retrieve_async( + await client.accounts.capabilities.retrieve_async( "acct_xxxxxxxxxxxxx", "card_payments", ) @@ -307,31 +236,6 @@ async def test_accounts_capabilities_get_2_service_async( api_base="https://api.stripe.com", ) - def test_accounts_capabilities_post_service_non_namespaced( - 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", - ) - def test_accounts_capabilities_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -359,7 +263,7 @@ def test_accounts_capabilities_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.capabilities.update( + client.accounts.capabilities.update( "acct_xxxxxxxxxxxxx", "card_payments", {"requested": True}, @@ -401,7 +305,7 @@ async def test_accounts_capabilities_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.capabilities.update_async( + await client.accounts.capabilities.update_async( "acct_xxxxxxxxxxxxx", "card_payments", {"requested": True}, @@ -414,26 +318,6 @@ async def test_accounts_capabilities_post_service_async( post_data="requested=true", ) - def test_accounts_delete_service_non_namespaced( - 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", - ) - def test_accounts_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.delete("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -454,7 +338,7 @@ def test_accounts_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.delete("acct_xxxxxxxxxxxxx") + client.accounts.delete("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx", @@ -486,7 +370,7 @@ async def test_accounts_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.delete_async("acct_xxxxxxxxxxxxx") + await client.accounts.delete_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx", @@ -494,29 +378,6 @@ async def test_accounts_delete_service_async( api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_delete_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -542,7 +403,7 @@ def test_accounts_external_accounts_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.delete( + client.accounts.external_accounts.delete( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -580,7 +441,7 @@ async def test_accounts_external_accounts_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.delete_async( + await client.accounts.external_accounts.delete_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -591,29 +452,6 @@ async def test_accounts_external_accounts_delete_service_async( api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_delete_2_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_delete_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -639,7 +477,7 @@ def test_accounts_external_accounts_delete_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.delete( + client.accounts.external_accounts.delete( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -677,7 +515,7 @@ async def test_accounts_external_accounts_delete_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.delete_async( + await client.accounts.external_accounts.delete_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -688,30 +526,6 @@ async def test_accounts_external_accounts_delete_2_service_async( api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_get_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -738,7 +552,7 @@ def test_accounts_external_accounts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.list( + client.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -777,7 +591,7 @@ async def test_accounts_external_accounts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.list_async( + await client.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -788,30 +602,6 @@ async def test_accounts_external_accounts_get_service_async( api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_get_2_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -839,7 +629,7 @@ def test_accounts_external_accounts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.list( + client.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) @@ -879,7 +669,7 @@ async def test_accounts_external_accounts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.list_async( + await client.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) @@ -890,30 +680,6 @@ async def test_accounts_external_accounts_get_2_service_async( api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_get_3_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -941,7 +707,7 @@ def test_accounts_external_accounts_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.list( + client.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) @@ -981,7 +747,7 @@ async def test_accounts_external_accounts_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.list_async( + await client.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) @@ -992,29 +758,6 @@ async def test_accounts_external_accounts_get_3_service_async( api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_get_4_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -1040,7 +783,7 @@ def test_accounts_external_accounts_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.retrieve( + client.accounts.external_accounts.retrieve( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -1078,7 +821,7 @@ async def test_accounts_external_accounts_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.retrieve_async( + await client.accounts.external_accounts.retrieve_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -1089,29 +832,6 @@ async def test_accounts_external_accounts_get_4_service_async( api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_get_5_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_get_5( self, http_client_mock: HTTPClientMock ) -> None: @@ -1137,7 +857,7 @@ def test_accounts_external_accounts_get_5_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.retrieve( + client.accounts.external_accounts.retrieve( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -1175,7 +895,7 @@ async def test_accounts_external_accounts_get_5_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.retrieve_async( + await client.accounts.external_accounts.retrieve_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -1186,30 +906,6 @@ async def test_accounts_external_accounts_get_5_service_async( api_base="https://api.stripe.com", ) - def test_accounts_external_accounts_post_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -1236,7 +932,7 @@ def test_accounts_external_accounts_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.create( + client.accounts.external_accounts.create( "acct_xxxxxxxxxxxxx", {"external_account": "btok_xxxxxxxxxxxxx"}, ) @@ -1276,7 +972,7 @@ async def test_accounts_external_accounts_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.create_async( + await client.accounts.external_accounts.create_async( "acct_xxxxxxxxxxxxx", {"external_account": "btok_xxxxxxxxxxxxx"}, ) @@ -1288,30 +984,6 @@ async def test_accounts_external_accounts_post_service_async( post_data="external_account=btok_xxxxxxxxxxxxx", ) - def test_accounts_external_accounts_post_2_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -1338,7 +1010,7 @@ def test_accounts_external_accounts_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.create( + client.accounts.external_accounts.create( "acct_xxxxxxxxxxxxx", {"external_account": "tok_xxxx_debit"}, ) @@ -1378,7 +1050,7 @@ async def test_accounts_external_accounts_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.create_async( + await client.accounts.external_accounts.create_async( "acct_xxxxxxxxxxxxx", {"external_account": "tok_xxxx_debit"}, ) @@ -1390,31 +1062,6 @@ async def test_accounts_external_accounts_post_2_service_async( post_data="external_account=tok_xxxx_debit", ) - def test_accounts_external_accounts_post_3_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -1442,7 +1089,7 @@ def test_accounts_external_accounts_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.update( + client.accounts.external_accounts.update( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1484,7 +1131,7 @@ async def test_accounts_external_accounts_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.update_async( + await client.accounts.external_accounts.update_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1497,31 +1144,6 @@ async def test_accounts_external_accounts_post_3_service_async( post_data="metadata[order_id]=6735", ) - def test_accounts_external_accounts_post_4_service_non_namespaced( - 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", - ) - def test_accounts_external_accounts_post_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -1549,7 +1171,7 @@ def test_accounts_external_accounts_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.external_accounts.update( + client.accounts.external_accounts.update( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1591,7 +1213,7 @@ async def test_accounts_external_accounts_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.external_accounts.update_async( + await client.accounts.external_accounts.update_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -1604,27 +1226,6 @@ async def test_accounts_external_accounts_post_4_service_async( post_data="metadata[order_id]=6735", ) - def test_accounts_get_service_non_namespaced( - 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", - ) - def test_accounts_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.list(limit=3) http_client_mock.assert_requested( @@ -1646,7 +1247,7 @@ def test_accounts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.list({"limit": 3}) + client.accounts.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/accounts", @@ -1679,7 +1280,7 @@ async def test_accounts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.list_async({"limit": 3}) + await client.accounts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/accounts", @@ -1687,26 +1288,6 @@ async def test_accounts_get_service_async( api_base="https://api.stripe.com", ) - def test_accounts_get_2_service_non_namespaced( - 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", - ) - def test_accounts_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.retrieve("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -1727,7 +1308,7 @@ def test_accounts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.retrieve("acct_xxxxxxxxxxxxx") + client.accounts.retrieve("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx", @@ -1759,7 +1340,7 @@ async def test_accounts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.retrieve_async("acct_xxxxxxxxxxxxx") + await client.accounts.retrieve_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx", @@ -1767,26 +1348,6 @@ async def test_accounts_get_2_service_async( api_base="https://api.stripe.com", ) - def test_accounts_login_links_post_service_non_namespaced( - 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", - ) - def test_accounts_login_links_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -1809,7 +1370,7 @@ def test_accounts_login_links_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.login_links.create("acct_xxxxxxxxxxxxx") + client.accounts.login_links.create("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", @@ -1841,7 +1402,7 @@ async def test_accounts_login_links_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.login_links.create_async("acct_xxxxxxxxxxxxx") + await client.accounts.login_links.create_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", @@ -1849,29 +1410,6 @@ async def test_accounts_login_links_post_service_async( api_base="https://api.stripe.com", ) - def test_accounts_persons_delete_service_non_namespaced( - 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", - ) - def test_accounts_persons_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -1897,7 +1435,7 @@ def test_accounts_persons_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.persons.delete( + client.accounts.persons.delete( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) @@ -1935,7 +1473,7 @@ async def test_accounts_persons_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.persons.delete_async( + await client.accounts.persons.delete_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) @@ -1946,30 +1484,6 @@ async def test_accounts_persons_delete_service_async( api_base="https://api.stripe.com", ) - def test_accounts_persons_get_service_non_namespaced( - 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", - ) - def test_accounts_persons_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -1996,7 +1510,7 @@ def test_accounts_persons_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.persons.list( + client.accounts.persons.list( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -2035,7 +1549,7 @@ async def test_accounts_persons_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.persons.list_async( + await client.accounts.persons.list_async( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -2046,29 +1560,6 @@ async def test_accounts_persons_get_service_async( api_base="https://api.stripe.com", ) - def test_accounts_persons_get_2_service_non_namespaced( - 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", - ) - def test_accounts_persons_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -2094,7 +1585,7 @@ def test_accounts_persons_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.persons.retrieve( + client.accounts.persons.retrieve( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) @@ -2132,7 +1623,7 @@ async def test_accounts_persons_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.persons.retrieve_async( + await client.accounts.persons.retrieve_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) @@ -2143,7 +1634,22 @@ async def test_accounts_persons_get_2_service_async( api_base="https://api.stripe.com", ) - def test_accounts_persons_post_service_non_namespaced( + 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( @@ -2167,45 +1673,6 @@ def test_accounts_persons_post_service_non_namespaced( post_data="first_name=Jane&last_name=Diaz", ) - 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.v1.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 @@ -2235,7 +1702,7 @@ async def test_accounts_persons_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.persons.create_async( + await client.accounts.persons.create_async( "acct_xxxxxxxxxxxxx", {"first_name": "Jane", "last_name": "Diaz"}, ) @@ -2247,31 +1714,6 @@ async def test_accounts_persons_post_service_async( post_data="first_name=Jane&last_name=Diaz", ) - def test_accounts_persons_post_2_service_non_namespaced( - 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", - ) - def test_accounts_persons_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -2299,7 +1741,7 @@ def test_accounts_persons_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.persons.update( + client.accounts.persons.update( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -2341,7 +1783,7 @@ async def test_accounts_persons_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.persons.update_async( + await client.accounts.persons.update_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -2354,37 +1796,6 @@ async def test_accounts_persons_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_accounts_post_service_non_namespaced( - 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", - ) - def test_accounts_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.create( type="custom", @@ -2414,7 +1825,7 @@ def test_accounts_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.create( + client.accounts.create( { "type": "custom", "country": "US", @@ -2466,7 +1877,7 @@ async def test_accounts_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.create_async( + await client.accounts.create_async( { "type": "custom", "country": "US", @@ -2485,30 +1896,6 @@ async def test_accounts_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_accounts_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.modify( "acct_xxxxxxxxxxxxx", @@ -2533,7 +1920,7 @@ def test_accounts_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.update( + client.accounts.update( "acct_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -2573,7 +1960,7 @@ async def test_accounts_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.update_async( + await client.accounts.update_async( "acct_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -2585,30 +1972,6 @@ async def test_accounts_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_accounts_reject_post_service_non_namespaced( - 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", - ) - def test_accounts_reject_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -2635,7 +1998,7 @@ def test_accounts_reject_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.accounts.reject( + client.accounts.reject( "acct_xxxxxxxxxxxxx", {"reason": "fraud"}, ) @@ -2675,7 +2038,7 @@ async def test_accounts_reject_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.accounts.reject_async( + await client.accounts.reject_async( "acct_xxxxxxxxxxxxx", {"reason": "fraud"}, ) @@ -2687,27 +2050,6 @@ async def test_accounts_reject_post_service_async( post_data="reason=fraud", ) - def test_application_fees_get_service_non_namespaced( - 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", - ) - def test_application_fees_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -2731,7 +2073,7 @@ def test_application_fees_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.application_fees.list({"limit": 3}) + client.application_fees.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/application_fees", @@ -2764,7 +2106,7 @@ async def test_application_fees_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.application_fees.list_async({"limit": 3}) + await client.application_fees.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/application_fees", @@ -2772,26 +2114,6 @@ async def test_application_fees_get_service_async( api_base="https://api.stripe.com", ) - def test_application_fees_get_2_service_non_namespaced( - 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", - ) - def test_application_fees_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -2814,7 +2136,7 @@ def test_application_fees_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.application_fees.retrieve("fee_xxxxxxxxxxxxx") + client.application_fees.retrieve("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx", @@ -2846,7 +2168,7 @@ async def test_application_fees_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.application_fees.retrieve_async("fee_xxxxxxxxxxxxx") + await client.application_fees.retrieve_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx", @@ -2854,30 +2176,6 @@ async def test_application_fees_get_2_service_async( api_base="https://api.stripe.com", ) - def test_application_fees_refunds_get_service_non_namespaced( - 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", - ) - def test_application_fees_refunds_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -2904,7 +2202,7 @@ def test_application_fees_refunds_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.application_fees.refunds.list( + client.application_fees.refunds.list( "fee_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -2943,7 +2241,7 @@ async def test_application_fees_refunds_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.application_fees.refunds.list_async( + await client.application_fees.refunds.list_async( "fee_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -2954,29 +2252,6 @@ async def test_application_fees_refunds_get_service_async( api_base="https://api.stripe.com", ) - def test_application_fees_refunds_get_2_service_non_namespaced( - 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", - ) - def test_application_fees_refunds_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -3002,7 +2277,7 @@ def test_application_fees_refunds_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.application_fees.refunds.retrieve( + client.application_fees.refunds.retrieve( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", ) @@ -3040,7 +2315,7 @@ async def test_application_fees_refunds_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.application_fees.refunds.retrieve_async( + await client.application_fees.refunds.retrieve_async( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", ) @@ -3051,26 +2326,6 @@ async def test_application_fees_refunds_get_2_service_async( api_base="https://api.stripe.com", ) - def test_application_fees_refunds_post_service_non_namespaced( - 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", - ) - def test_application_fees_refunds_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -3093,7 +2348,7 @@ def test_application_fees_refunds_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.application_fees.refunds.create("fee_xxxxxxxxxxxxx") + client.application_fees.refunds.create("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", @@ -3125,9 +2380,7 @@ async def test_application_fees_refunds_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.application_fees.refunds.create_async( - "fee_xxxxxxxxxxxxx", - ) + await client.application_fees.refunds.create_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", @@ -3135,7 +2388,22 @@ async def test_application_fees_refunds_post_service_async( api_base="https://api.stripe.com", ) - def test_application_fees_refunds_post_2_service_non_namespaced( + 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( @@ -3160,46 +2428,6 @@ def test_application_fees_refunds_post_2_service_non_namespaced( post_data="metadata[order_id]=6735", ) - 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.v1.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 @@ -3229,7 +2457,7 @@ async def test_application_fees_refunds_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.application_fees.refunds.update_async( + await client.application_fees.refunds.update_async( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -3242,32 +2470,6 @@ async def test_application_fees_refunds_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_apps_secrets_delete_post_service_non_namespaced( - 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", - ) - def test_apps_secrets_delete_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -3294,7 +2496,7 @@ def test_apps_secrets_delete_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.apps.secrets.delete_where( + client.apps.secrets.delete_where( { "name": "my-api-key", "scope": {"type": "account"}, @@ -3336,7 +2538,7 @@ async def test_apps_secrets_delete_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.apps.secrets.delete_where_async( + await client.apps.secrets.delete_where_async( { "name": "my-api-key", "scope": {"type": "account"}, @@ -3350,32 +2552,6 @@ async def test_apps_secrets_delete_post_service_async( post_data="name=my-api-key&scope[type]=account", ) - def test_apps_secrets_find_get_service_non_namespaced( - 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", - ) - def test_apps_secrets_find_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -3402,7 +2578,7 @@ def test_apps_secrets_find_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.apps.secrets.find( + client.apps.secrets.find( { "name": "sec_123", "scope": {"type": "account"}, @@ -3443,7 +2619,7 @@ async def test_apps_secrets_find_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.apps.secrets.find_async( + await client.apps.secrets.find_async( { "name": "sec_123", "scope": {"type": "account"}, @@ -3456,27 +2632,6 @@ async def test_apps_secrets_find_get_service_async( api_base="https://api.stripe.com", ) - def test_apps_secrets_get_service_non_namespaced( - 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", - ) - def test_apps_secrets_get(self, http_client_mock: HTTPClientMock) -> None: stripe.apps.Secret.list( scope={"type": "account"}, @@ -3501,7 +2656,7 @@ def test_apps_secrets_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) + client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", @@ -3537,7 +2692,7 @@ async def test_apps_secrets_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.apps.secrets.list_async( + await client.apps.secrets.list_async( { "scope": {"type": "account"}, "limit": 2, @@ -3550,27 +2705,6 @@ async def test_apps_secrets_get_service_async( api_base="https://api.stripe.com", ) - def test_apps_secrets_get_2_service_non_namespaced( - 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", - ) - def test_apps_secrets_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -3597,7 +2731,7 @@ def test_apps_secrets_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) + client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", @@ -3633,7 +2767,7 @@ async def test_apps_secrets_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.apps.secrets.list_async( + await client.apps.secrets.list_async( { "scope": {"type": "account"}, "limit": 2, @@ -3646,33 +2780,6 @@ async def test_apps_secrets_get_2_service_async( api_base="https://api.stripe.com", ) - def test_apps_secrets_post_service_non_namespaced( - 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", - ) - def test_apps_secrets_post(self, http_client_mock: HTTPClientMock) -> None: stripe.apps.Secret.create( name="sec_123", @@ -3698,7 +2805,7 @@ def test_apps_secrets_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.apps.secrets.create( + client.apps.secrets.create( { "name": "sec_123", "payload": "very secret string", @@ -3742,7 +2849,7 @@ async def test_apps_secrets_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.apps.secrets.create_async( + await client.apps.secrets.create_async( { "name": "sec_123", "payload": "very secret string", @@ -3757,33 +2864,6 @@ async def test_apps_secrets_post_service_async( post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) - def test_apps_secrets_post_2_service_non_namespaced( - 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", - ) - def test_apps_secrets_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -3811,7 +2891,7 @@ def test_apps_secrets_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.apps.secrets.create( + client.apps.secrets.create( { "name": "my-api-key", "payload": "secret_key_xxxxxx", @@ -3855,7 +2935,7 @@ async def test_apps_secrets_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.apps.secrets.create_async( + await client.apps.secrets.create_async( { "name": "my-api-key", "payload": "secret_key_xxxxxx", @@ -3870,27 +2950,6 @@ async def test_apps_secrets_post_2_service_async( post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) - def test_balance_transactions_get_service_non_namespaced( - 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", - ) - def test_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -3914,7 +2973,7 @@ def test_balance_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.balance_transactions.list({"limit": 3}) + client.balance_transactions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/balance_transactions", @@ -3947,7 +3006,7 @@ async def test_balance_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.balance_transactions.list_async({"limit": 3}) + await client.balance_transactions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/balance_transactions", @@ -3955,26 +3014,6 @@ async def test_balance_transactions_get_service_async( api_base="https://api.stripe.com", ) - def test_balance_transactions_get_2_service_non_namespaced( - 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", - ) - def test_balance_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -3997,7 +3036,7 @@ def test_balance_transactions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.balance_transactions.retrieve("txn_xxxxxxxxxxxxx") + client.balance_transactions.retrieve("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", @@ -4029,9 +3068,7 @@ async def test_balance_transactions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.balance_transactions.retrieve_async( - "txn_xxxxxxxxxxxxx" - ) + await client.balance_transactions.retrieve_async("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", @@ -4039,27 +3076,6 @@ async def test_balance_transactions_get_2_service_async( api_base="https://api.stripe.com", ) - def test_billing_portal_configurations_get_service_non_namespaced( - 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", - ) - def test_billing_portal_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -4083,7 +3099,7 @@ def test_billing_portal_configurations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.billing_portal.configurations.list({"limit": 3}) + client.billing_portal.configurations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations", @@ -4116,7 +3132,7 @@ async def test_billing_portal_configurations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.billing_portal.configurations.list_async({"limit": 3}) + await client.billing_portal.configurations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations", @@ -4124,26 +3140,6 @@ async def test_billing_portal_configurations_get_service_async( api_base="https://api.stripe.com", ) - def test_billing_portal_configurations_get_2_service_non_namespaced( - 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", - ) - def test_billing_portal_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -4166,7 +3162,7 @@ def test_billing_portal_configurations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.billing_portal.configurations.retrieve("bpc_xxxxxxxxxxxxx") + client.billing_portal.configurations.retrieve("bpc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", @@ -4200,7 +3196,7 @@ async def test_billing_portal_configurations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.billing_portal.configurations.retrieve_async( + await client.billing_portal.configurations.retrieve_async( "bpc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -4210,41 +3206,6 @@ async def test_billing_portal_configurations_get_2_service_async( api_base="https://api.stripe.com", ) - def test_billing_portal_configurations_post_service_non_namespaced( - 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", - ) - def test_billing_portal_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -4280,7 +3241,7 @@ def test_billing_portal_configurations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.billing_portal.configurations.create( + client.billing_portal.configurations.create( { "features": { "customer_update": { @@ -4340,7 +3301,7 @@ async def test_billing_portal_configurations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.billing_portal.configurations.create_async( + await client.billing_portal.configurations.create_async( { "features": { "customer_update": { @@ -4363,35 +3324,6 @@ async def test_billing_portal_configurations_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_billing_portal_configurations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -4421,7 +3353,7 @@ def test_billing_portal_configurations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.billing_portal.configurations.update( + client.billing_portal.configurations.update( "bpc_xxxxxxxxxxxxx", { "business_profile": { @@ -4469,7 +3401,7 @@ async def test_billing_portal_configurations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.billing_portal.configurations.update_async( + await client.billing_portal.configurations.update_async( "bpc_xxxxxxxxxxxxx", { "business_profile": { @@ -4486,32 +3418,6 @@ async def test_billing_portal_configurations_post_2_service_async( 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_service_non_namespaced( - 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", - ) - def test_billing_portal_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -4538,7 +3444,7 @@ def test_billing_portal_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.billing_portal.sessions.create( + client.billing_portal.sessions.create( { "customer": "cus_xxxxxxxxxxxxx", "return_url": "https://example.com/account", @@ -4580,7 +3486,7 @@ async def test_billing_portal_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.billing_portal.sessions.create_async( + await client.billing_portal.sessions.create_async( { "customer": "cus_xxxxxxxxxxxxx", "return_url": "https://example.com/account", @@ -4594,26 +3500,6 @@ async def test_billing_portal_sessions_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) - def test_charges_capture_post_service_non_namespaced( - 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", - ) - def test_charges_capture_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -4636,7 +3522,7 @@ def test_charges_capture_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.charges.capture("ch_xxxxxxxxxxxxx") + client.charges.capture("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx/capture", @@ -4668,7 +3554,7 @@ async def test_charges_capture_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.charges.capture_async("ch_xxxxxxxxxxxxx") + await client.charges.capture_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx/capture", @@ -4676,27 +3562,6 @@ async def test_charges_capture_post_service_async( api_base="https://api.stripe.com", ) - def test_charges_get_service_non_namespaced( - 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", - ) - def test_charges_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.list(limit=3) http_client_mock.assert_requested( @@ -4718,7 +3583,7 @@ def test_charges_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.charges.list({"limit": 3}) + client.charges.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/charges", @@ -4751,7 +3616,7 @@ async def test_charges_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.charges.list_async({"limit": 3}) + await client.charges.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/charges", @@ -4759,26 +3624,6 @@ async def test_charges_get_service_async( api_base="https://api.stripe.com", ) - def test_charges_get_2_service_non_namespaced( - 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", - ) - def test_charges_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.retrieve("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -4799,7 +3644,7 @@ def test_charges_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.charges.retrieve("ch_xxxxxxxxxxxxx") + client.charges.retrieve("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/charges/ch_xxxxxxxxxxxxx", @@ -4831,7 +3676,7 @@ async def test_charges_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.charges.retrieve_async("ch_xxxxxxxxxxxxx") + await client.charges.retrieve_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/charges/ch_xxxxxxxxxxxxx", @@ -4839,34 +3684,6 @@ async def test_charges_get_2_service_async( api_base="https://api.stripe.com", ) - def test_charges_post_service_non_namespaced( - 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", - ) - def test_charges_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.create( amount=2000, @@ -4893,7 +3710,7 @@ def test_charges_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.charges.create( + client.charges.create( { "amount": 2000, "currency": "usd", @@ -4939,7 +3756,7 @@ async def test_charges_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.charges.create_async( + await client.charges.create_async( { "amount": 2000, "currency": "usd", @@ -4955,30 +3772,6 @@ async def test_charges_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_charges_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.modify( "ch_xxxxxxxxxxxxx", @@ -5003,7 +3796,7 @@ def test_charges_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.charges.update( + client.charges.update( "ch_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -5043,7 +3836,7 @@ async def test_charges_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.charges.update_async( + await client.charges.update_async( "ch_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -5055,31 +3848,6 @@ async def test_charges_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_charges_search_get_service_non_namespaced( - 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", - ) - def test_charges_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -5105,7 +3873,7 @@ def test_charges_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.charges.search( + client.charges.search( { "query": "amount>999 AND metadata['order_id']:'6735'", } @@ -5144,7 +3912,7 @@ async def test_charges_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.charges.search_async( + await client.charges.search_async( { "query": "amount>999 AND metadata['order_id']:'6735'", } @@ -5156,26 +3924,6 @@ async def test_charges_search_get_service_async( api_base="https://api.stripe.com", ) - def test_checkout_sessions_expire_post_service_non_namespaced( - 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", - ) - def test_checkout_sessions_expire_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -5198,7 +3946,7 @@ def test_checkout_sessions_expire_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.checkout.sessions.expire("sess_xyz") + client.checkout.sessions.expire("sess_xyz") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/sess_xyz/expire", @@ -5230,7 +3978,7 @@ async def test_checkout_sessions_expire_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.checkout.sessions.expire_async("sess_xyz") + await client.checkout.sessions.expire_async("sess_xyz") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/sess_xyz/expire", @@ -5238,26 +3986,6 @@ async def test_checkout_sessions_expire_post_service_async( api_base="https://api.stripe.com", ) - def test_checkout_sessions_expire_post_2_service_non_namespaced( - 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", - ) - def test_checkout_sessions_expire_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -5280,7 +4008,7 @@ def test_checkout_sessions_expire_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.checkout.sessions.expire("cs_test_xxxxxxxxxxxxx") + client.checkout.sessions.expire("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", @@ -5312,7 +4040,7 @@ async def test_checkout_sessions_expire_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.checkout.sessions.expire_async("cs_test_xxxxxxxxxxxxx") + await client.checkout.sessions.expire_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", @@ -5320,27 +4048,6 @@ async def test_checkout_sessions_expire_post_2_service_async( api_base="https://api.stripe.com", ) - def test_checkout_sessions_get_service_non_namespaced( - 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", - ) - def test_checkout_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -5364,7 +4071,7 @@ def test_checkout_sessions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.checkout.sessions.list({"limit": 3}) + client.checkout.sessions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions", @@ -5397,7 +4104,7 @@ async def test_checkout_sessions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.checkout.sessions.list_async({"limit": 3}) + await client.checkout.sessions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions", @@ -5405,26 +4112,6 @@ async def test_checkout_sessions_get_service_async( api_base="https://api.stripe.com", ) - def test_checkout_sessions_get_2_service_non_namespaced( - 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", - ) - def test_checkout_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -5447,7 +4134,7 @@ def test_checkout_sessions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.checkout.sessions.retrieve("cs_test_xxxxxxxxxxxxx") + client.checkout.sessions.retrieve("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", @@ -5479,9 +4166,7 @@ async def test_checkout_sessions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.checkout.sessions.retrieve_async( - "cs_test_xxxxxxxxxxxxx", - ) + await client.checkout.sessions.retrieve_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", @@ -5489,26 +4174,6 @@ async def test_checkout_sessions_get_2_service_async( api_base="https://api.stripe.com", ) - def test_checkout_sessions_line_items_get_service_non_namespaced( - 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", - ) - def test_checkout_sessions_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -5531,7 +4196,7 @@ def test_checkout_sessions_line_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.checkout.sessions.line_items.list("sess_xyz") + client.checkout.sessions.line_items.list("sess_xyz") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/sess_xyz/line_items", @@ -5563,7 +4228,7 @@ async def test_checkout_sessions_line_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.checkout.sessions.line_items.list_async("sess_xyz") + await client.checkout.sessions.line_items.list_async("sess_xyz") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/sess_xyz/line_items", @@ -5571,45 +4236,6 @@ async def test_checkout_sessions_line_items_get_service_async( api_base="https://api.stripe.com", ) - def test_checkout_sessions_post_service_non_namespaced( - 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", - ) - def test_checkout_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -5649,7 +4275,7 @@ def test_checkout_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.checkout.sessions.create( + client.checkout.sessions.create( { "success_url": "https://example.com/success", "cancel_url": "https://example.com/cancel", @@ -5717,7 +4343,7 @@ async def test_checkout_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.checkout.sessions.create_async( + await client.checkout.sessions.create_async( { "success_url": "https://example.com/success", "cancel_url": "https://example.com/cancel", @@ -5744,35 +4370,6 @@ async def test_checkout_sessions_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_checkout_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -5800,7 +4397,7 @@ def test_checkout_sessions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.checkout.sessions.create( + client.checkout.sessions.create( { "success_url": "https://example.com/success", "line_items": [ @@ -5846,7 +4443,7 @@ async def test_checkout_sessions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.checkout.sessions.create_async( + await client.checkout.sessions.create_async( { "success_url": "https://example.com/success", "line_items": [ @@ -5883,27 +4480,6 @@ def test_core_events_get_service( api_base="https://api.stripe.com", ) - def test_country_specs_get_service_non_namespaced( - 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", - ) - def test_country_specs_get(self, http_client_mock: HTTPClientMock) -> None: stripe.CountrySpec.list(limit=3) http_client_mock.assert_requested( @@ -5925,7 +4501,7 @@ def test_country_specs_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.country_specs.list({"limit": 3}) + client.country_specs.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/country_specs", @@ -5958,7 +4534,7 @@ async def test_country_specs_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.country_specs.list_async({"limit": 3}) + await client.country_specs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/country_specs", @@ -5966,26 +4542,6 @@ async def test_country_specs_get_service_async( api_base="https://api.stripe.com", ) - def test_country_specs_get_2_service_non_namespaced( - 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", - ) - def test_country_specs_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -6008,7 +4564,7 @@ def test_country_specs_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.country_specs.retrieve("US") + client.country_specs.retrieve("US") http_client_mock.assert_requested( "get", path="/v1/country_specs/US", @@ -6040,7 +4596,7 @@ async def test_country_specs_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.country_specs.retrieve_async("US") + await client.country_specs.retrieve_async("US") http_client_mock.assert_requested( "get", path="/v1/country_specs/US", @@ -6048,26 +4604,6 @@ async def test_country_specs_get_2_service_async( api_base="https://api.stripe.com", ) - def test_coupons_delete_service_non_namespaced( - 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", - ) - def test_coupons_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.delete("Z4OV52SU") http_client_mock.assert_requested( @@ -6088,7 +4624,7 @@ def test_coupons_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.coupons.delete("Z4OV52SU") + client.coupons.delete("Z4OV52SU") http_client_mock.assert_requested( "delete", path="/v1/coupons/Z4OV52SU", @@ -6120,7 +4656,7 @@ async def test_coupons_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.coupons.delete_async("Z4OV52SU") + await client.coupons.delete_async("Z4OV52SU") http_client_mock.assert_requested( "delete", path="/v1/coupons/Z4OV52SU", @@ -6128,27 +4664,6 @@ async def test_coupons_delete_service_async( api_base="https://api.stripe.com", ) - def test_coupons_get_service_non_namespaced( - 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", - ) - def test_coupons_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.list(limit=3) http_client_mock.assert_requested( @@ -6170,7 +4685,7 @@ def test_coupons_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.coupons.list({"limit": 3}) + client.coupons.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/coupons", @@ -6203,7 +4718,7 @@ async def test_coupons_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.coupons.list_async({"limit": 3}) + await client.coupons.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/coupons", @@ -6211,26 +4726,6 @@ async def test_coupons_get_service_async( api_base="https://api.stripe.com", ) - def test_coupons_get_2_service_non_namespaced( - 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", - ) - def test_coupons_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.retrieve("Z4OV52SU") http_client_mock.assert_requested( @@ -6251,7 +4746,7 @@ def test_coupons_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.coupons.retrieve("Z4OV52SU") + client.coupons.retrieve("Z4OV52SU") http_client_mock.assert_requested( "get", path="/v1/coupons/Z4OV52SU", @@ -6283,7 +4778,7 @@ async def test_coupons_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.coupons.retrieve_async("Z4OV52SU") + await client.coupons.retrieve_async("Z4OV52SU") http_client_mock.assert_requested( "get", path="/v1/coupons/Z4OV52SU", @@ -6291,27 +4786,6 @@ async def test_coupons_get_2_service_async( api_base="https://api.stripe.com", ) - def test_coupons_post_service_non_namespaced( - 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": "once"}) - http_client_mock.assert_requested( - "post", - path="/v1/coupons", - query_string="", - api_base="https://api.stripe.com", - post_data="percent_off=25.5&duration=once", - ) - def test_coupons_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.create( percent_off=25.5, @@ -6336,7 +4810,7 @@ def test_coupons_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.coupons.create({"percent_off": 25.5, "duration": "once"}) + client.coupons.create({"percent_off": 25.5, "duration": "once"}) http_client_mock.assert_requested( "post", path="/v1/coupons", @@ -6373,7 +4847,7 @@ async def test_coupons_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.coupons.create_async( + await client.coupons.create_async( { "percent_off": 25.5, "duration": "once", @@ -6387,7 +4861,19 @@ async def test_coupons_post_service_async( post_data="percent_off=25.5&duration=once", ) - def test_coupons_post_2_service_non_namespaced( + 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( @@ -6411,42 +4897,6 @@ def test_coupons_post_2_service_non_namespaced( post_data="metadata[order_id]=6735", ) - 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.v1.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 @@ -6475,7 +4925,7 @@ async def test_coupons_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.coupons.update_async( + await client.coupons.update_async( "Z4OV52SU", {"metadata": {"order_id": "6735"}}, ) @@ -6487,27 +4937,6 @@ async def test_coupons_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_credit_notes_get_service_non_namespaced( - 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", - ) - def test_credit_notes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.CreditNote.list(limit=3) http_client_mock.assert_requested( @@ -6529,7 +4958,7 @@ def test_credit_notes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.credit_notes.list({"limit": 3}) + client.credit_notes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/credit_notes", @@ -6562,7 +4991,7 @@ async def test_credit_notes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.credit_notes.list_async({"limit": 3}) + await client.credit_notes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/credit_notes", @@ -6570,30 +4999,6 @@ async def test_credit_notes_get_service_async( api_base="https://api.stripe.com", ) - def test_credit_notes_lines_get_service_non_namespaced( - 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", - ) - def test_credit_notes_lines_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -6620,7 +5025,7 @@ def test_credit_notes_lines_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.credit_notes.line_items.list( + client.credit_notes.line_items.list( "cn_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -6659,7 +5064,7 @@ async def test_credit_notes_lines_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.credit_notes.line_items.list_async( + await client.credit_notes.line_items.list_async( "cn_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -6670,38 +5075,6 @@ async def test_credit_notes_lines_get_service_async( api_base="https://api.stripe.com", ) - def test_credit_notes_post_service_non_namespaced( - 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", - ) - def test_credit_notes_post(self, http_client_mock: HTTPClientMock) -> None: stripe.CreditNote.create( invoice="in_xxxxxxxxxxxxx", @@ -6732,7 +5105,7 @@ def test_credit_notes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.credit_notes.create( + client.credit_notes.create( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ @@ -6786,7 +5159,7 @@ async def test_credit_notes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.credit_notes.create_async( + await client.credit_notes.create_async( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ @@ -6806,38 +5179,6 @@ async def test_credit_notes_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_credit_notes_preview_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -6870,7 +5211,7 @@ def test_credit_notes_preview_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.credit_notes.preview( + client.credit_notes.preview( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ @@ -6923,7 +5264,7 @@ async def test_credit_notes_preview_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.credit_notes.preview_async( + await client.credit_notes.preview_async( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ @@ -6942,32 +5283,6 @@ async def test_credit_notes_preview_get_service_async( api_base="https://api.stripe.com", ) - def test_credit_notes_preview_lines_get_service_non_namespaced( - 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", - ) - def test_credit_notes_preview_lines_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -6994,7 +5309,7 @@ def test_credit_notes_preview_lines_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.credit_notes.preview_lines.list( + client.credit_notes.preview_lines.list( { "limit": 3, "invoice": "in_xxxxxxxxxxxxx", @@ -7035,7 +5350,7 @@ async def test_credit_notes_preview_lines_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.credit_notes.preview_lines.list_async( + await client.credit_notes.preview_lines.list_async( { "limit": 3, "invoice": "in_xxxxxxxxxxxxx", @@ -7048,26 +5363,6 @@ async def test_credit_notes_preview_lines_get_service_async( api_base="https://api.stripe.com", ) - def test_credit_notes_void_post_service_non_namespaced( - 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", - ) - def test_credit_notes_void_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -7090,7 +5385,7 @@ def test_credit_notes_void_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.credit_notes.void_credit_note("cn_xxxxxxxxxxxxx") + client.credit_notes.void_credit_note("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", @@ -7122,7 +5417,7 @@ async def test_credit_notes_void_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.credit_notes.void_credit_note_async("cn_xxxxxxxxxxxxx") + await client.credit_notes.void_credit_note_async("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", @@ -7130,32 +5425,6 @@ async def test_credit_notes_void_post_service_async( api_base="https://api.stripe.com", ) - def test_customer_sessions_post_service_non_namespaced( - 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", - ) - def test_customer_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -7182,7 +5451,7 @@ def test_customer_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customer_sessions.create( + client.customer_sessions.create( { "customer": "cus_123", "components": {"buy_button": {"enabled": True}}, @@ -7224,7 +5493,7 @@ async def test_customer_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customer_sessions.create_async( + await client.customer_sessions.create_async( { "customer": "cus_123", "components": {"buy_button": {"enabled": True}}, @@ -7238,30 +5507,6 @@ async def test_customer_sessions_post_service_async( post_data="customer=cus_123&components[buy_button][enabled]=true", ) - def test_customers_balance_transactions_get_service_non_namespaced( - 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", - ) - def test_customers_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -7288,7 +5533,7 @@ def test_customers_balance_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.balance_transactions.list( + client.customers.balance_transactions.list( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -7327,7 +5572,7 @@ async def test_customers_balance_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.balance_transactions.list_async( + await client.customers.balance_transactions.list_async( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -7338,7 +5583,20 @@ async def test_customers_balance_transactions_get_service_async( api_base="https://api.stripe.com", ) - def test_customers_balance_transactions_get_2_service_non_namespaced( + 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( @@ -7361,10 +5619,11 @@ def test_customers_balance_transactions_get_2_service_non_namespaced( api_base="https://api.stripe.com", ) - def test_customers_balance_transactions_get_2( + @pytest.mark.anyio + async def test_customers_balance_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.retrieve_balance_transaction( + await stripe.Customer.retrieve_balance_transaction_async( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", ) @@ -7374,7 +5633,8 @@ def test_customers_balance_transactions_get_2( query_string="", ) - def test_customers_balance_transactions_get_2_service( + @pytest.mark.anyio + async def test_customers_balance_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -7386,7 +5646,7 @@ def test_customers_balance_transactions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.balance_transactions.retrieve( + await client.customers.balance_transactions.retrieve_async( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", ) @@ -7397,68 +5657,6 @@ def test_customers_balance_transactions_get_2_service( 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.v1.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_service_non_namespaced( - 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", - ) - def test_customers_balance_transactions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -7486,7 +5684,7 @@ def test_customers_balance_transactions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.balance_transactions.create( + client.customers.balance_transactions.create( "cus_xxxxxxxxxxxxx", {"amount": -500, "currency": "usd"}, ) @@ -7527,7 +5725,7 @@ async def test_customers_balance_transactions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.balance_transactions.create_async( + await client.customers.balance_transactions.create_async( "cus_xxxxxxxxxxxxx", {"amount": -500, "currency": "usd"}, ) @@ -7539,31 +5737,6 @@ async def test_customers_balance_transactions_post_service_async( post_data="amount=-500¤cy=usd", ) - def test_customers_balance_transactions_post_2_service_non_namespaced( - 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", - ) - def test_customers_balance_transactions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -7591,7 +5764,7 @@ def test_customers_balance_transactions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.balance_transactions.update( + client.customers.balance_transactions.update( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -7633,7 +5806,7 @@ async def test_customers_balance_transactions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.balance_transactions.update_async( + await client.customers.balance_transactions.update_async( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -7646,26 +5819,6 @@ async def test_customers_balance_transactions_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_customers_cash_balance_get_service_non_namespaced( - 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", - ) - def test_customers_cash_balance_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -7688,7 +5841,7 @@ def test_customers_cash_balance_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.cash_balance.retrieve("cus_123") + client.customers.cash_balance.retrieve("cus_123") http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance", @@ -7720,7 +5873,7 @@ async def test_customers_cash_balance_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.cash_balance.retrieve_async("cus_123") + await client.customers.cash_balance.retrieve_async("cus_123") http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance", @@ -7728,30 +5881,6 @@ async def test_customers_cash_balance_get_service_async( api_base="https://api.stripe.com", ) - def test_customers_cash_balance_post_service_non_namespaced( - 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", - ) - def test_customers_cash_balance_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -7778,7 +5907,7 @@ def test_customers_cash_balance_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.cash_balance.update( + client.customers.cash_balance.update( "cus_123", {"settings": {"reconciliation_mode": "manual"}}, ) @@ -7818,7 +5947,7 @@ async def test_customers_cash_balance_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.cash_balance.update_async( + await client.customers.cash_balance.update_async( "cus_123", {"settings": {"reconciliation_mode": "manual"}}, ) @@ -7830,30 +5959,6 @@ async def test_customers_cash_balance_post_service_async( post_data="settings[reconciliation_mode]=manual", ) - def test_customers_cash_balance_transactions_get_service_non_namespaced( - 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", - ) - def test_customers_cash_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -7880,7 +5985,7 @@ def test_customers_cash_balance_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.cash_balance_transactions.list( + client.customers.cash_balance_transactions.list( "cus_123", {"limit": 3}, ) @@ -7919,7 +6024,7 @@ async def test_customers_cash_balance_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.cash_balance_transactions.list_async( + await client.customers.cash_balance_transactions.list_async( "cus_123", {"limit": 3}, ) @@ -7930,26 +6035,6 @@ async def test_customers_cash_balance_transactions_get_service_async( api_base="https://api.stripe.com", ) - def test_customers_delete_service_non_namespaced( - 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", - ) - def test_customers_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.delete("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -7970,7 +6055,7 @@ def test_customers_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.delete("cus_xxxxxxxxxxxxx") + client.customers.delete("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", @@ -8002,7 +6087,7 @@ async def test_customers_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.delete_async("cus_xxxxxxxxxxxxx") + await client.customers.delete_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", @@ -8010,37 +6095,6 @@ async def test_customers_delete_service_async( api_base="https://api.stripe.com", ) - def test_customers_funding_instructions_post_service_non_namespaced( - 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", - ) - def test_customers_funding_instructions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -8072,7 +6126,7 @@ def test_customers_funding_instructions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.funding_instructions.create( + client.customers.funding_instructions.create( "cus_123", { "bank_transfer": { @@ -8124,7 +6178,7 @@ async def test_customers_funding_instructions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.funding_instructions.create_async( + await client.customers.funding_instructions.create_async( "cus_123", { "bank_transfer": { @@ -8143,27 +6197,6 @@ async def test_customers_funding_instructions_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_customers_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.list(limit=3) http_client_mock.assert_requested( @@ -8185,7 +6218,7 @@ def test_customers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.list({"limit": 3}) + client.customers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", @@ -8218,28 +6251,7 @@ async def test_customers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.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_service_non_namespaced( - 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}) + await client.customers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", @@ -8268,7 +6280,7 @@ def test_customers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.list({"limit": 3}) + client.customers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", @@ -8301,7 +6313,7 @@ async def test_customers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.list_async({"limit": 3}) + await client.customers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", @@ -8309,26 +6321,6 @@ async def test_customers_get_2_service_async( api_base="https://api.stripe.com", ) - def test_customers_get_3_service_non_namespaced( - 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", - ) - def test_customers_get_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -8349,7 +6341,7 @@ def test_customers_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.retrieve("cus_xxxxxxxxxxxxx") + client.customers.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", @@ -8381,7 +6373,7 @@ async def test_customers_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.retrieve_async("cus_xxxxxxxxxxxxx") + await client.customers.retrieve_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", @@ -8389,30 +6381,6 @@ async def test_customers_get_3_service_async( api_base="https://api.stripe.com", ) - def test_customers_payment_methods_get_service_non_namespaced( - 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", - ) - def test_customers_payment_methods_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -8439,7 +6407,7 @@ def test_customers_payment_methods_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_methods.list( + client.customers.payment_methods.list( "cus_xyz", {"type": "card"}, ) @@ -8478,7 +6446,7 @@ async def test_customers_payment_methods_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_methods.list_async( + await client.customers.payment_methods.list_async( "cus_xyz", {"type": "card"}, ) @@ -8489,30 +6457,6 @@ async def test_customers_payment_methods_get_service_async( api_base="https://api.stripe.com", ) - def test_customers_payment_methods_get_2_service_non_namespaced( - 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", - ) - def test_customers_payment_methods_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -8539,7 +6483,7 @@ def test_customers_payment_methods_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_methods.list( + client.customers.payment_methods.list( "cus_xxxxxxxxxxxxx", {"type": "card"}, ) @@ -8578,7 +6522,7 @@ async def test_customers_payment_methods_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_methods.list_async( + await client.customers.payment_methods.list_async( "cus_xxxxxxxxxxxxx", {"type": "card"}, ) @@ -8589,31 +6533,6 @@ async def test_customers_payment_methods_get_2_service_async( api_base="https://api.stripe.com", ) - def test_customers_post_service_non_namespaced( - 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", - ) - 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)", @@ -8637,7 +6556,7 @@ def test_customers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.create( + client.customers.create( { "description": "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", } @@ -8677,7 +6596,7 @@ async def test_customers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.create_async( + await client.customers.create_async( { "description": "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", } @@ -8690,30 +6609,6 @@ async def test_customers_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_customers_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.modify( "cus_xxxxxxxxxxxxx", @@ -8738,7 +6633,7 @@ def test_customers_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.update( + client.customers.update( "cus_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -8778,7 +6673,7 @@ async def test_customers_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.update_async( + await client.customers.update_async( "cus_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -8790,31 +6685,6 @@ async def test_customers_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_customers_search_get_service_non_namespaced( - 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", - ) - def test_customers_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -8840,7 +6710,7 @@ def test_customers_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.search( + client.customers.search( { "query": "name:'fakename' AND metadata['foo']:'bar'", } @@ -8879,32 +6749,7 @@ async def test_customers_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.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_service_non_namespaced( - 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( + await client.customers.search_async( { "query": "name:'fakename' AND metadata['foo']:'bar'", } @@ -8941,7 +6786,7 @@ def test_customers_search_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.search( + client.customers.search( { "query": "name:'fakename' AND metadata['foo']:'bar'", } @@ -8980,7 +6825,7 @@ async def test_customers_search_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.search_async( + await client.customers.search_async( { "query": "name:'fakename' AND metadata['foo']:'bar'", } @@ -8992,29 +6837,6 @@ async def test_customers_search_get_2_service_async( api_base="https://api.stripe.com", ) - def test_customers_sources_delete_service_non_namespaced( - 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", - ) - def test_customers_sources_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -9040,7 +6862,7 @@ def test_customers_sources_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.sources.detach( + client.sources.detach( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -9078,7 +6900,7 @@ async def test_customers_sources_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.sources.detach_async( + await client.sources.detach_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -9089,29 +6911,6 @@ async def test_customers_sources_delete_service_async( api_base="https://api.stripe.com", ) - def test_customers_sources_delete_2_service_non_namespaced( - 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", - ) - def test_customers_sources_delete_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -9137,7 +6936,7 @@ def test_customers_sources_delete_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.sources.detach( + client.sources.detach( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -9175,7 +6974,7 @@ async def test_customers_sources_delete_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.sources.detach_async( + await client.sources.detach_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -9186,30 +6985,6 @@ async def test_customers_sources_delete_2_service_async( api_base="https://api.stripe.com", ) - def test_customers_sources_get_service_non_namespaced( - 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", - ) - def test_customers_sources_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -9237,7 +7012,7 @@ def test_customers_sources_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_sources.list( + client.customers.payment_sources.list( "cus_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) @@ -9277,7 +7052,7 @@ async def test_customers_sources_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_sources.list_async( + await client.customers.payment_sources.list_async( "cus_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) @@ -9288,30 +7063,6 @@ async def test_customers_sources_get_service_async( api_base="https://api.stripe.com", ) - def test_customers_sources_get_2_service_non_namespaced( - 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", - ) - def test_customers_sources_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -9339,7 +7090,7 @@ def test_customers_sources_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_sources.list( + client.customers.payment_sources.list( "cus_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) @@ -9379,7 +7130,7 @@ async def test_customers_sources_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_sources.list_async( + await client.customers.payment_sources.list_async( "cus_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) @@ -9390,7 +7141,20 @@ async def test_customers_sources_get_2_service_async( api_base="https://api.stripe.com", ) - def test_customers_sources_get_3_service_non_namespaced( + 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( @@ -9413,10 +7177,11 @@ def test_customers_sources_get_3_service_non_namespaced( api_base="https://api.stripe.com", ) - def test_customers_sources_get_3( + @pytest.mark.anyio + async def test_customers_sources_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.Customer.retrieve_source( + await stripe.Customer.retrieve_source_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -9426,7 +7191,8 @@ def test_customers_sources_get_3( query_string="", ) - def test_customers_sources_get_3_service( + @pytest.mark.anyio + async def test_customers_sources_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -9438,7 +7204,7 @@ def test_customers_sources_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_sources.retrieve( + await client.customers.payment_sources.retrieve_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) @@ -9449,67 +7215,6 @@ def test_customers_sources_get_3_service( 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.v1.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_service_non_namespaced( - 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", - ) - def test_customers_sources_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -9535,7 +7240,7 @@ def test_customers_sources_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_sources.retrieve( + client.customers.payment_sources.retrieve( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -9573,7 +7278,7 @@ async def test_customers_sources_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_sources.retrieve_async( + await client.customers.payment_sources.retrieve_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) @@ -9584,31 +7289,6 @@ async def test_customers_sources_get_4_service_async( api_base="https://api.stripe.com", ) - def test_customers_sources_post_service_non_namespaced( - 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", - ) - def test_customers_sources_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -9636,7 +7316,7 @@ def test_customers_sources_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_sources.update( + client.customers.payment_sources.update( "cus_123", "card_123", {"account_holder_name": "Kamil"}, @@ -9678,7 +7358,7 @@ async def test_customers_sources_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_sources.update_async( + await client.customers.payment_sources.update_async( "cus_123", "card_123", {"account_holder_name": "Kamil"}, @@ -9691,30 +7371,6 @@ async def test_customers_sources_post_service_async( post_data="account_holder_name=Kamil", ) - def test_customers_sources_post_2_service_non_namespaced( - 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", - ) - def test_customers_sources_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -9741,7 +7397,7 @@ def test_customers_sources_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_sources.create( + client.customers.payment_sources.create( "cus_xxxxxxxxxxxxx", {"source": "btok_xxxxxxxxxxxxx"}, ) @@ -9781,7 +7437,7 @@ async def test_customers_sources_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_sources.create_async( + await client.customers.payment_sources.create_async( "cus_xxxxxxxxxxxxx", {"source": "btok_xxxxxxxxxxxxx"}, ) @@ -9793,30 +7449,6 @@ async def test_customers_sources_post_2_service_async( post_data="source=btok_xxxxxxxxxxxxx", ) - def test_customers_sources_post_3_service_non_namespaced( - 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", - ) - def test_customers_sources_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -9843,7 +7475,7 @@ def test_customers_sources_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_sources.create( + client.customers.payment_sources.create( "cus_xxxxxxxxxxxxx", {"source": "tok_xxxx"}, ) @@ -9883,7 +7515,7 @@ async def test_customers_sources_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_sources.create_async( + await client.customers.payment_sources.create_async( "cus_xxxxxxxxxxxxx", {"source": "tok_xxxx"}, ) @@ -9895,31 +7527,6 @@ async def test_customers_sources_post_3_service_async( post_data="source=tok_xxxx", ) - def test_customers_sources_post_4_service_non_namespaced( - 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", - ) - def test_customers_sources_post_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -9947,7 +7554,7 @@ def test_customers_sources_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_sources.update( + client.customers.payment_sources.update( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -9989,7 +7596,7 @@ async def test_customers_sources_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_sources.update_async( + await client.customers.payment_sources.update_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -10002,31 +7609,6 @@ async def test_customers_sources_post_4_service_async( post_data="metadata[order_id]=6735", ) - def test_customers_sources_post_5_service_non_namespaced( - 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", - ) - def test_customers_sources_post_5( self, http_client_mock: HTTPClientMock ) -> None: @@ -10054,7 +7636,7 @@ def test_customers_sources_post_5_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.payment_sources.update( + client.customers.payment_sources.update( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"name": "Jenny Rosen"}, @@ -10096,7 +7678,7 @@ async def test_customers_sources_post_5_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.payment_sources.update_async( + await client.customers.payment_sources.update_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"name": "Jenny Rosen"}, @@ -10109,29 +7691,6 @@ async def test_customers_sources_post_5_service_async( post_data="name=Jenny%20Rosen", ) - def test_customers_tax_ids_delete_service_non_namespaced( - 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", - ) - def test_customers_tax_ids_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -10157,7 +7716,7 @@ def test_customers_tax_ids_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.tax_ids.delete( + client.customers.tax_ids.delete( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) @@ -10195,7 +7754,7 @@ async def test_customers_tax_ids_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.tax_ids.delete_async( + await client.customers.tax_ids.delete_async( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) @@ -10206,30 +7765,6 @@ async def test_customers_tax_ids_delete_service_async( api_base="https://api.stripe.com", ) - def test_customers_tax_ids_get_service_non_namespaced( - 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", - ) - def test_customers_tax_ids_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -10256,7 +7791,7 @@ def test_customers_tax_ids_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.tax_ids.list( + client.customers.tax_ids.list( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -10295,7 +7830,7 @@ async def test_customers_tax_ids_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.tax_ids.list_async( + await client.customers.tax_ids.list_async( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -10306,29 +7841,6 @@ async def test_customers_tax_ids_get_service_async( api_base="https://api.stripe.com", ) - def test_customers_tax_ids_get_2_service_non_namespaced( - 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", - ) - def test_customers_tax_ids_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -10354,7 +7866,7 @@ def test_customers_tax_ids_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.customers.tax_ids.retrieve( + client.customers.tax_ids.retrieve( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) @@ -10392,7 +7904,7 @@ async def test_customers_tax_ids_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.tax_ids.retrieve_async( + await client.customers.tax_ids.retrieve_async( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) @@ -10403,7 +7915,22 @@ async def test_customers_tax_ids_get_2_service_async( api_base="https://api.stripe.com", ) - def test_customers_tax_ids_post_service_non_namespaced( + 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( @@ -10427,45 +7954,6 @@ def test_customers_tax_ids_post_service_non_namespaced( post_data="type=eu_vat&value=DE123456789", ) - 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.v1.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 @@ -10495,7 +7983,7 @@ async def test_customers_tax_ids_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.customers.tax_ids.create_async( + await client.customers.tax_ids.create_async( "cus_xxxxxxxxxxxxx", {"type": "eu_vat", "value": "DE123456789"}, ) @@ -10507,26 +7995,6 @@ async def test_customers_tax_ids_post_service_async( post_data="type=eu_vat&value=DE123456789", ) - def test_disputes_close_post_service_non_namespaced( - 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", - ) - def test_disputes_close_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -10549,7 +8017,7 @@ def test_disputes_close_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.disputes.close("dp_xxxxxxxxxxxxx") + client.disputes.close("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx/close", @@ -10581,7 +8049,7 @@ async def test_disputes_close_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.disputes.close_async("dp_xxxxxxxxxxxxx") + await client.disputes.close_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx/close", @@ -10589,27 +8057,6 @@ async def test_disputes_close_post_service_async( api_base="https://api.stripe.com", ) - def test_disputes_get_service_non_namespaced( - 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", - ) - def test_disputes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Dispute.list(limit=3) http_client_mock.assert_requested( @@ -10631,7 +8078,7 @@ def test_disputes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.disputes.list({"limit": 3}) + client.disputes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/disputes", @@ -10664,7 +8111,7 @@ async def test_disputes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.disputes.list_async({"limit": 3}) + await client.disputes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/disputes", @@ -10672,26 +8119,6 @@ async def test_disputes_get_service_async( api_base="https://api.stripe.com", ) - def test_disputes_get_2_service_non_namespaced( - 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", - ) - def test_disputes_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Dispute.retrieve("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -10712,7 +8139,7 @@ def test_disputes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.disputes.retrieve("dp_xxxxxxxxxxxxx") + client.disputes.retrieve("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/disputes/dp_xxxxxxxxxxxxx", @@ -10744,7 +8171,7 @@ async def test_disputes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.disputes.retrieve_async("dp_xxxxxxxxxxxxx") + await client.disputes.retrieve_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/disputes/dp_xxxxxxxxxxxxx", @@ -10752,30 +8179,6 @@ async def test_disputes_get_2_service_async( api_base="https://api.stripe.com", ) - def test_disputes_post_service_non_namespaced( - 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", - ) - def test_disputes_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Dispute.modify( "dp_xxxxxxxxxxxxx", @@ -10800,7 +8203,7 @@ def test_disputes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.disputes.update( + client.disputes.update( "dp_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -10840,7 +8243,7 @@ async def test_disputes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.disputes.update_async( + await client.disputes.update_async( "dp_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -10852,27 +8255,6 @@ async def test_disputes_post_service_async( post_data="metadata[order_id]=6735", ) - def test_events_get_service_non_namespaced( - 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", - ) - def test_events_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Event.list(limit=3) http_client_mock.assert_requested( @@ -10894,7 +8276,7 @@ def test_events_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.events.list({"limit": 3}) + client.events.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/events", @@ -10927,7 +8309,7 @@ async def test_events_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.events.list_async({"limit": 3}) + await client.events.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/events", @@ -10935,26 +8317,6 @@ async def test_events_get_service_async( api_base="https://api.stripe.com", ) - def test_events_get_2_service_non_namespaced( - 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", - ) - def test_events_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Event.retrieve("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -10975,7 +8337,7 @@ def test_events_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.events.retrieve("evt_xxxxxxxxxxxxx") + client.events.retrieve("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/events/evt_xxxxxxxxxxxxx", @@ -11007,7 +8369,7 @@ async def test_events_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.events.retrieve_async("evt_xxxxxxxxxxxxx") + await client.events.retrieve_async("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/events/evt_xxxxxxxxxxxxx", @@ -11015,27 +8377,6 @@ async def test_events_get_2_service_async( api_base="https://api.stripe.com", ) - def test_file_links_get_service_non_namespaced( - 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", - ) - def test_file_links_get(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.list(limit=3) http_client_mock.assert_requested( @@ -11057,7 +8398,7 @@ def test_file_links_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.file_links.list({"limit": 3}) + client.file_links.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/file_links", @@ -11090,7 +8431,7 @@ async def test_file_links_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.file_links.list_async({"limit": 3}) + await client.file_links.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/file_links", @@ -11098,26 +8439,6 @@ async def test_file_links_get_service_async( api_base="https://api.stripe.com", ) - def test_file_links_get_2_service_non_namespaced( - 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", - ) - def test_file_links_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.retrieve("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -11138,7 +8459,7 @@ def test_file_links_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.file_links.retrieve("link_xxxxxxxxxxxxx") + client.file_links.retrieve("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/file_links/link_xxxxxxxxxxxxx", @@ -11170,7 +8491,7 @@ async def test_file_links_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.file_links.retrieve_async("link_xxxxxxxxxxxxx") + await client.file_links.retrieve_async("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/file_links/link_xxxxxxxxxxxxx", @@ -11178,27 +8499,6 @@ async def test_file_links_get_2_service_async( api_base="https://api.stripe.com", ) - def test_file_links_post_service_non_namespaced( - 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", - ) - def test_file_links_post(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.create(file="file_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -11220,7 +8520,7 @@ def test_file_links_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.file_links.create({"file": "file_xxxxxxxxxxxxx"}) + client.file_links.create({"file": "file_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/file_links", @@ -11254,7 +8554,7 @@ async def test_file_links_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.file_links.create_async({"file": "file_xxxxxxxxxxxxx"}) + await client.file_links.create_async({"file": "file_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/file_links", @@ -11263,30 +8563,6 @@ async def test_file_links_post_service_async( post_data="file=file_xxxxxxxxxxxxx", ) - def test_file_links_post_2_service_non_namespaced( - 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", - ) - def test_file_links_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.modify( "link_xxxxxxxxxxxxx", @@ -11311,7 +8587,7 @@ def test_file_links_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.file_links.update( + client.file_links.update( "link_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -11351,7 +8627,7 @@ async def test_file_links_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.file_links.update_async( + await client.file_links.update_async( "link_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -11363,27 +8639,6 @@ async def test_file_links_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_files_get_service_non_namespaced( - 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", - ) - def test_files_get(self, http_client_mock: HTTPClientMock) -> None: stripe.File.list(limit=3) http_client_mock.assert_requested( @@ -11403,7 +8658,7 @@ def test_files_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client=http_client_mock.get_mock_http_client(), ) - client.v1.files.list({"limit": 3}) + client.files.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/files", @@ -11436,7 +8691,7 @@ async def test_files_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.files.list_async({"limit": 3}) + await client.files.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/files", @@ -11444,26 +8699,6 @@ async def test_files_get_service_async( api_base="https://api.stripe.com", ) - def test_files_get_2_service_non_namespaced( - 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", - ) - def test_files_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.File.retrieve("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -11484,7 +8719,7 @@ def test_files_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.files.retrieve("file_xxxxxxxxxxxxx") + client.files.retrieve("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/files/file_xxxxxxxxxxxxx", @@ -11516,7 +8751,7 @@ async def test_files_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.files.retrieve_async("file_xxxxxxxxxxxxx") + await client.files.retrieve_async("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/files/file_xxxxxxxxxxxxx", @@ -11524,31 +8759,6 @@ async def test_files_get_2_service_async( api_base="https://api.stripe.com", ) - def test_files_post_service_non_namespaced( - 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", - ) - def test_files_post(self, http_client_mock: HTTPClientMock) -> None: stripe.File.create( purpose="account_requirement", @@ -11572,7 +8782,7 @@ def test_files_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.files.create( + client.files.create( { "purpose": "account_requirement", "file": io.StringIO("foo"), @@ -11612,7 +8822,7 @@ async def test_files_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.files.create_async( + await client.files.create_async( { "purpose": "account_requirement", "file": io.StringIO("foo"), @@ -11625,26 +8835,6 @@ async def test_files_post_service_async( api_base="https://files.stripe.com", ) - def test_financial_connections_accounts_disconnect_post_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_disconnect_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -11667,7 +8857,7 @@ def test_financial_connections_accounts_disconnect_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.disconnect("fca_xyz") + client.financial_connections.accounts.disconnect("fca_xyz") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/disconnect", @@ -11699,9 +8889,7 @@ async def test_financial_connections_accounts_disconnect_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.disconnect_async( - "fca_xyz", - ) + await client.financial_connections.accounts.disconnect_async("fca_xyz") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/disconnect", @@ -11709,26 +8897,6 @@ async def test_financial_connections_accounts_disconnect_post_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_disconnect_post_2_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_disconnect_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -11751,9 +8919,7 @@ def test_financial_connections_accounts_disconnect_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.disconnect( - "fca_xxxxxxxxxxxxx" - ) + client.financial_connections.accounts.disconnect("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", @@ -11787,7 +8953,7 @@ async def test_financial_connections_accounts_disconnect_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.disconnect_async( + await client.financial_connections.accounts.disconnect_async( "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -11797,26 +8963,6 @@ async def test_financial_connections_accounts_disconnect_post_2_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_get_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -11839,7 +8985,7 @@ def test_financial_connections_accounts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.list() + client.financial_connections.accounts.list() http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", @@ -11871,7 +9017,7 @@ async def test_financial_connections_accounts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.list_async() + await client.financial_connections.accounts.list_async() http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", @@ -11879,26 +9025,6 @@ async def test_financial_connections_accounts_get_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_get_2_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -11921,7 +9047,7 @@ def test_financial_connections_accounts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.retrieve("fca_xyz") + client.financial_connections.accounts.retrieve("fca_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz", @@ -11953,9 +9079,7 @@ async def test_financial_connections_accounts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.retrieve_async( - "fca_xyz" - ) + await client.financial_connections.accounts.retrieve_async("fca_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz", @@ -11963,31 +9087,6 @@ async def test_financial_connections_accounts_get_2_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_get_3_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -12013,7 +9112,7 @@ def test_financial_connections_accounts_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.list( + client.financial_connections.accounts.list( { "account_holder": {"customer": "cus_xxxxxxxxxxxxx"}, } @@ -12052,7 +9151,7 @@ async def test_financial_connections_accounts_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.list_async( + await client.financial_connections.accounts.list_async( { "account_holder": {"customer": "cus_xxxxxxxxxxxxx"}, } @@ -12064,26 +9163,6 @@ async def test_financial_connections_accounts_get_3_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_get_4_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -12106,7 +9185,7 @@ def test_financial_connections_accounts_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.retrieve("fca_xxxxxxxxxxxxx") + client.financial_connections.accounts.retrieve("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", @@ -12140,7 +9219,7 @@ async def test_financial_connections_accounts_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.retrieve_async( + await client.financial_connections.accounts.retrieve_async( "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -12150,30 +9229,6 @@ async def test_financial_connections_accounts_get_4_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_owners_get_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_owners_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -12200,7 +9255,7 @@ def test_financial_connections_accounts_owners_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.owners.list( + client.financial_connections.accounts.owners.list( "fca_xyz", {"ownership": "fcaowns_xyz"}, ) @@ -12239,7 +9294,7 @@ async def test_financial_connections_accounts_owners_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.owners.list_async( + await client.financial_connections.accounts.owners.list_async( "fca_xyz", {"ownership": "fcaowns_xyz"}, ) @@ -12250,30 +9305,6 @@ async def test_financial_connections_accounts_owners_get_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_owners_get_2_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_owners_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -12301,7 +9332,7 @@ def test_financial_connections_accounts_owners_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.owners.list( + client.financial_connections.accounts.owners.list( "fca_xxxxxxxxxxxxx", {"limit": 3, "ownership": "fcaowns_xxxxxxxxxxxxx"}, ) @@ -12341,7 +9372,7 @@ async def test_financial_connections_accounts_owners_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.owners.list_async( + await client.financial_connections.accounts.owners.list_async( "fca_xxxxxxxxxxxxx", {"limit": 3, "ownership": "fcaowns_xxxxxxxxxxxxx"}, ) @@ -12352,30 +9383,6 @@ async def test_financial_connections_accounts_owners_get_2_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_accounts_refresh_post_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_refresh_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -12402,7 +9409,7 @@ def test_financial_connections_accounts_refresh_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.refresh( + client.financial_connections.accounts.refresh( "fca_xyz", {"features": ["balance"]}, ) @@ -12442,7 +9449,7 @@ async def test_financial_connections_accounts_refresh_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.refresh_async( + await client.financial_connections.accounts.refresh_async( "fca_xyz", {"features": ["balance"]}, ) @@ -12454,7 +9461,21 @@ async def test_financial_connections_accounts_refresh_post_service_async( post_data="features[0]=balance", ) - def test_financial_connections_accounts_subscribe_post_service_non_namespaced( + 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( @@ -12478,44 +9499,6 @@ def test_financial_connections_accounts_subscribe_post_service_non_namespaced( post_data="features[0]=transactions", ) - 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.v1.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 @@ -12544,7 +9527,7 @@ async def test_financial_connections_accounts_subscribe_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.subscribe_async( + await client.financial_connections.accounts.subscribe_async( "fa_123", {"features": ["transactions"]}, ) @@ -12556,30 +9539,6 @@ async def test_financial_connections_accounts_subscribe_post_service_async( post_data="features[0]=transactions", ) - def test_financial_connections_accounts_unsubscribe_post_service_non_namespaced( - 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", - ) - def test_financial_connections_accounts_unsubscribe_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -12606,7 +9565,7 @@ def test_financial_connections_accounts_unsubscribe_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.accounts.unsubscribe( + client.financial_connections.accounts.unsubscribe( "fa_123", {"features": ["transactions"]}, ) @@ -12646,7 +9605,7 @@ async def test_financial_connections_accounts_unsubscribe_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.accounts.unsubscribe_async( + await client.financial_connections.accounts.unsubscribe_async( "fa_123", {"features": ["transactions"]}, ) @@ -12658,26 +9617,6 @@ async def test_financial_connections_accounts_unsubscribe_post_service_async( post_data="features[0]=transactions", ) - def test_financial_connections_sessions_get_service_non_namespaced( - 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", - ) - def test_financial_connections_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -12700,7 +9639,7 @@ def test_financial_connections_sessions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.sessions.retrieve("fcsess_xyz") + client.financial_connections.sessions.retrieve("fcsess_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xyz", @@ -12732,8 +9671,8 @@ async def test_financial_connections_sessions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.sessions.retrieve_async( - "fcsess_xyz", + await client.financial_connections.sessions.retrieve_async( + "fcsess_xyz" ) http_client_mock.assert_requested( "get", @@ -12742,26 +9681,6 @@ async def test_financial_connections_sessions_get_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_sessions_get_2_service_non_namespaced( - 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", - ) - def test_financial_connections_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -12784,9 +9703,7 @@ def test_financial_connections_sessions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.sessions.retrieve( - "fcsess_xxxxxxxxxxxxx", - ) + client.financial_connections.sessions.retrieve("fcsess_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", @@ -12820,7 +9737,7 @@ async def test_financial_connections_sessions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.sessions.retrieve_async( + await client.financial_connections.sessions.retrieve_async( "fcsess_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -12830,32 +9747,6 @@ async def test_financial_connections_sessions_get_2_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_sessions_post_service_non_namespaced( - 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", - ) - def test_financial_connections_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -12882,7 +9773,7 @@ def test_financial_connections_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.sessions.create( + client.financial_connections.sessions.create( { "account_holder": {"type": "customer", "customer": "cus_123"}, "permissions": ["balances"], @@ -12924,7 +9815,7 @@ async def test_financial_connections_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.sessions.create_async( + await client.financial_connections.sessions.create_async( { "account_holder": {"type": "customer", "customer": "cus_123"}, "permissions": ["balances"], @@ -12938,36 +9829,6 @@ async def test_financial_connections_sessions_post_service_async( post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) - def test_financial_connections_sessions_post_2_service_non_namespaced( - 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", - ) - def test_financial_connections_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -12998,7 +9859,7 @@ def test_financial_connections_sessions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.sessions.create( + client.financial_connections.sessions.create( { "account_holder": { "type": "customer", @@ -13048,7 +9909,7 @@ async def test_financial_connections_sessions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.sessions.create_async( + await client.financial_connections.sessions.create_async( { "account_holder": { "type": "customer", @@ -13066,26 +9927,6 @@ async def test_financial_connections_sessions_post_2_service_async( 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_service_non_namespaced( - 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", - ) - def test_financial_connections_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -13108,7 +9949,7 @@ def test_financial_connections_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.transactions.retrieve("tr_123") + client.financial_connections.transactions.retrieve("tr_123") http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions/tr_123", @@ -13140,8 +9981,8 @@ async def test_financial_connections_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.transactions.retrieve_async( - "tr_123", + await client.financial_connections.transactions.retrieve_async( + "tr_123" ) http_client_mock.assert_requested( "get", @@ -13150,27 +9991,6 @@ async def test_financial_connections_transactions_get_service_async( api_base="https://api.stripe.com", ) - def test_financial_connections_transactions_get_2_service_non_namespaced( - 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", - ) - def test_financial_connections_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -13194,11 +10014,7 @@ def test_financial_connections_transactions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.financial_connections.transactions.list( - { - "account": "fca_xyz", - } - ) + client.financial_connections.transactions.list({"account": "fca_xyz"}) http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions", @@ -13233,7 +10049,7 @@ async def test_financial_connections_transactions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.financial_connections.transactions.list_async( + await client.financial_connections.transactions.list_async( { "account": "fca_xyz", } @@ -13245,27 +10061,6 @@ async def test_financial_connections_transactions_get_2_service_async( api_base="https://api.stripe.com", ) - def test_identity_verification_reports_get_service_non_namespaced( - 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", - ) - def test_identity_verification_reports_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -13289,7 +10084,7 @@ def test_identity_verification_reports_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.identity.verification_reports.list({"limit": 3}) + client.identity.verification_reports.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports", @@ -13322,7 +10117,7 @@ async def test_identity_verification_reports_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.identity.verification_reports.list_async({"limit": 3}) + await client.identity.verification_reports.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports", @@ -13330,26 +10125,6 @@ async def test_identity_verification_reports_get_service_async( api_base="https://api.stripe.com", ) - def test_identity_verification_reports_get_2_service_non_namespaced( - 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", - ) - def test_identity_verification_reports_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -13372,7 +10147,7 @@ def test_identity_verification_reports_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.identity.verification_reports.retrieve("vr_xxxxxxxxxxxxx") + client.identity.verification_reports.retrieve("vr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", @@ -13406,7 +10181,7 @@ async def test_identity_verification_reports_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.identity.verification_reports.retrieve_async( + await client.identity.verification_reports.retrieve_async( "vr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -13416,26 +10191,6 @@ async def test_identity_verification_reports_get_2_service_async( api_base="https://api.stripe.com", ) - def test_identity_verification_sessions_cancel_post_service_non_namespaced( - 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", - ) - def test_identity_verification_sessions_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -13458,7 +10213,7 @@ def test_identity_verification_sessions_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.identity.verification_sessions.cancel("vs_xxxxxxxxxxxxx") + client.identity.verification_sessions.cancel("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", @@ -13492,7 +10247,7 @@ async def test_identity_verification_sessions_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.identity.verification_sessions.cancel_async( + await client.identity.verification_sessions.cancel_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -13502,27 +10257,6 @@ async def test_identity_verification_sessions_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_identity_verification_sessions_get_service_non_namespaced( - 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", - ) - def test_identity_verification_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -13546,7 +10280,7 @@ def test_identity_verification_sessions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.identity.verification_sessions.list({"limit": 3}) + client.identity.verification_sessions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions", @@ -13579,7 +10313,7 @@ async def test_identity_verification_sessions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.identity.verification_sessions.list_async({"limit": 3}) + await client.identity.verification_sessions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions", @@ -13587,26 +10321,6 @@ async def test_identity_verification_sessions_get_service_async( api_base="https://api.stripe.com", ) - def test_identity_verification_sessions_get_2_service_non_namespaced( - 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", - ) - def test_identity_verification_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -13629,7 +10343,7 @@ def test_identity_verification_sessions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.identity.verification_sessions.retrieve("vs_xxxxxxxxxxxxx") + client.identity.verification_sessions.retrieve("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", @@ -13663,7 +10377,7 @@ async def test_identity_verification_sessions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.identity.verification_sessions.retrieve_async( + await client.identity.verification_sessions.retrieve_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -13673,27 +10387,6 @@ async def test_identity_verification_sessions_get_2_service_async( api_base="https://api.stripe.com", ) - def test_identity_verification_sessions_post_service_non_namespaced( - 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", - ) - def test_identity_verification_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -13717,7 +10410,7 @@ def test_identity_verification_sessions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.identity.verification_sessions.create({"type": "document"}) + client.identity.verification_sessions.create({"type": "document"}) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions", @@ -13751,7 +10444,7 @@ async def test_identity_verification_sessions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.identity.verification_sessions.create_async( + await client.identity.verification_sessions.create_async( { "type": "document", } @@ -13764,30 +10457,6 @@ async def test_identity_verification_sessions_post_service_async( post_data="type=document", ) - def test_identity_verification_sessions_post_2_service_non_namespaced( - 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", - ) - def test_identity_verification_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -13814,7 +10483,7 @@ def test_identity_verification_sessions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.identity.verification_sessions.update( + client.identity.verification_sessions.update( "vs_xxxxxxxxxxxxx", {"type": "id_number"}, ) @@ -13854,7 +10523,7 @@ async def test_identity_verification_sessions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.identity.verification_sessions.update_async( + await client.identity.verification_sessions.update_async( "vs_xxxxxxxxxxxxx", {"type": "id_number"}, ) @@ -13866,26 +10535,6 @@ async def test_identity_verification_sessions_post_2_service_async( post_data="type=id_number", ) - def test_identity_verification_sessions_redact_post_service_non_namespaced( - 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", - ) - def test_identity_verification_sessions_redact_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -13908,7 +10557,7 @@ def test_identity_verification_sessions_redact_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.identity.verification_sessions.redact("vs_xxxxxxxxxxxxx") + client.identity.verification_sessions.redact("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", @@ -13942,7 +10591,7 @@ async def test_identity_verification_sessions_redact_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.identity.verification_sessions.redact_async( + await client.identity.verification_sessions.redact_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -13952,26 +10601,6 @@ async def test_identity_verification_sessions_redact_post_service_async( api_base="https://api.stripe.com", ) - def test_invoiceitems_delete_service_non_namespaced( - 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", - ) - def test_invoiceitems_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -13994,7 +10623,7 @@ def test_invoiceitems_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoice_items.delete("ii_xxxxxxxxxxxxx") + client.invoice_items.delete("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", @@ -14026,7 +10655,7 @@ async def test_invoiceitems_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoice_items.delete_async("ii_xxxxxxxxxxxxx") + await client.invoice_items.delete_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", @@ -14034,27 +10663,6 @@ async def test_invoiceitems_delete_service_async( api_base="https://api.stripe.com", ) - def test_invoiceitems_get_service_non_namespaced( - 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", - ) - def test_invoiceitems_get(self, http_client_mock: HTTPClientMock) -> None: stripe.InvoiceItem.list(limit=3) http_client_mock.assert_requested( @@ -14076,7 +10684,7 @@ def test_invoiceitems_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoice_items.list({"limit": 3}) + client.invoice_items.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoiceitems", @@ -14109,7 +10717,7 @@ async def test_invoiceitems_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoice_items.list_async({"limit": 3}) + await client.invoice_items.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoiceitems", @@ -14117,26 +10725,6 @@ async def test_invoiceitems_get_service_async( api_base="https://api.stripe.com", ) - def test_invoiceitems_get_2_service_non_namespaced( - 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", - ) - def test_invoiceitems_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -14159,7 +10747,7 @@ def test_invoiceitems_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoice_items.retrieve("ii_xxxxxxxxxxxxx") + client.invoice_items.retrieve("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", @@ -14191,7 +10779,7 @@ async def test_invoiceitems_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoice_items.retrieve_async("ii_xxxxxxxxxxxxx") + await client.invoice_items.retrieve_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", @@ -14199,27 +10787,6 @@ async def test_invoiceitems_get_2_service_async( api_base="https://api.stripe.com", ) - def test_invoiceitems_post_service_non_namespaced( - 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"}) - http_client_mock.assert_requested( - "post", - path="/v1/invoiceitems", - query_string="", - api_base="https://api.stripe.com", - post_data="customer=cus_xxxxxxxxxxxxx", - ) - def test_invoiceitems_post(self, http_client_mock: HTTPClientMock) -> None: stripe.InvoiceItem.create(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -14241,7 +10808,7 @@ def test_invoiceitems_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoice_items.create({"customer": "cus_xxxxxxxxxxxxx"}) + client.invoice_items.create({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/invoiceitems", @@ -14275,7 +10842,7 @@ async def test_invoiceitems_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoice_items.create_async( + await client.invoice_items.create_async( { "customer": "cus_xxxxxxxxxxxxx", } @@ -14288,30 +10855,6 @@ async def test_invoiceitems_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx", ) - def test_invoiceitems_post_2_service_non_namespaced( - 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", - ) - def test_invoiceitems_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -14338,7 +10881,7 @@ def test_invoiceitems_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoice_items.update( + client.invoice_items.update( "ii_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -14378,7 +10921,7 @@ async def test_invoiceitems_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoice_items.update_async( + await client.invoice_items.update_async( "ii_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -14390,26 +10933,6 @@ async def test_invoiceitems_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_invoices_delete_service_non_namespaced( - 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", - ) - def test_invoices_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.delete("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -14430,7 +10953,7 @@ def test_invoices_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.delete("in_xxxxxxxxxxxxx") + client.invoices.delete("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoices/in_xxxxxxxxxxxxx", @@ -14462,7 +10985,7 @@ async def test_invoices_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.delete_async("in_xxxxxxxxxxxxx") + await client.invoices.delete_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoices/in_xxxxxxxxxxxxx", @@ -14470,26 +10993,6 @@ async def test_invoices_delete_service_async( api_base="https://api.stripe.com", ) - def test_invoices_finalize_post_service_non_namespaced( - 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", - ) - def test_invoices_finalize_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -14512,7 +11015,7 @@ def test_invoices_finalize_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.finalize_invoice("in_xxxxxxxxxxxxx") + client.invoices.finalize_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", @@ -14544,7 +11047,7 @@ async def test_invoices_finalize_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.finalize_invoice_async("in_xxxxxxxxxxxxx") + await client.invoices.finalize_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", @@ -14552,27 +11055,6 @@ async def test_invoices_finalize_post_service_async( api_base="https://api.stripe.com", ) - def test_invoices_get_service_non_namespaced( - 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", - ) - def test_invoices_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.list(limit=3) http_client_mock.assert_requested( @@ -14594,7 +11076,7 @@ def test_invoices_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.list({"limit": 3}) + client.invoices.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoices", @@ -14627,7 +11109,7 @@ async def test_invoices_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.list_async({"limit": 3}) + await client.invoices.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoices", @@ -14635,26 +11117,6 @@ async def test_invoices_get_service_async( api_base="https://api.stripe.com", ) - def test_invoices_get_2_service_non_namespaced( - 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", - ) - def test_invoices_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.retrieve("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -14675,7 +11137,7 @@ def test_invoices_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.retrieve("in_xxxxxxxxxxxxx") + client.invoices.retrieve("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", @@ -14707,7 +11169,7 @@ async def test_invoices_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.retrieve_async("in_xxxxxxxxxxxxx") + await client.invoices.retrieve_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", @@ -14715,30 +11177,6 @@ async def test_invoices_get_2_service_async( api_base="https://api.stripe.com", ) - def test_invoices_get_3_service_non_namespaced( - 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", - ) - def test_invoices_get_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.retrieve( "in_xxxxxxxxxxxxx", @@ -14763,7 +11201,7 @@ def test_invoices_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.retrieve( + client.invoices.retrieve( "in_xxxxxxxxxxxxx", {"expand": ["customer"]}, ) @@ -14802,7 +11240,7 @@ async def test_invoices_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.retrieve_async( + await client.invoices.retrieve_async( "in_xxxxxxxxxxxxx", {"expand": ["customer"]}, ) @@ -14813,26 +11251,6 @@ async def test_invoices_get_3_service_async( api_base="https://api.stripe.com", ) - def test_invoices_mark_uncollectible_post_service_non_namespaced( - 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", - ) - def test_invoices_mark_uncollectible_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -14855,7 +11273,7 @@ def test_invoices_mark_uncollectible_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.mark_uncollectible("in_xxxxxxxxxxxxx") + client.invoices.mark_uncollectible("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", @@ -14887,7 +11305,7 @@ async def test_invoices_mark_uncollectible_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.mark_uncollectible_async("in_xxxxxxxxxxxxx") + await client.invoices.mark_uncollectible_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", @@ -14895,26 +11313,6 @@ async def test_invoices_mark_uncollectible_post_service_async( api_base="https://api.stripe.com", ) - def test_invoices_pay_post_service_non_namespaced( - 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", - ) - def test_invoices_pay_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.pay("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -14935,7 +11333,7 @@ def test_invoices_pay_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.pay("in_xxxxxxxxxxxxx") + client.invoices.pay("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/pay", @@ -14967,7 +11365,7 @@ async def test_invoices_pay_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.pay_async("in_xxxxxxxxxxxxx") + await client.invoices.pay_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/pay", @@ -14975,27 +11373,6 @@ async def test_invoices_pay_post_service_async( api_base="https://api.stripe.com", ) - def test_invoices_post_service_non_namespaced( - 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", - ) - def test_invoices_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.create(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -15017,7 +11394,7 @@ def test_invoices_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.create({"customer": "cus_xxxxxxxxxxxxx"}) + client.invoices.create({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/invoices", @@ -15051,9 +11428,7 @@ async def test_invoices_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.create_async( - {"customer": "cus_xxxxxxxxxxxxx"} - ) + await client.invoices.create_async({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/invoices", @@ -15062,30 +11437,6 @@ async def test_invoices_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx", ) - def test_invoices_post_2_service_non_namespaced( - 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", - ) - def test_invoices_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.modify( "in_xxxxxxxxxxxxx", @@ -15110,7 +11461,7 @@ def test_invoices_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.update( + client.invoices.update( "in_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -15150,7 +11501,7 @@ async def test_invoices_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.update_async( + await client.invoices.update_async( "in_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -15162,31 +11513,6 @@ async def test_invoices_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_invoices_search_get_service_non_namespaced( - 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", - ) - def test_invoices_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -15212,7 +11538,7 @@ def test_invoices_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.search( + client.invoices.search( { "query": "total>999 AND metadata['order_id']:'6735'", } @@ -15251,7 +11577,7 @@ async def test_invoices_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.search_async( + await client.invoices.search_async( { "query": "total>999 AND metadata['order_id']:'6735'", } @@ -15263,26 +11589,6 @@ async def test_invoices_search_get_service_async( api_base="https://api.stripe.com", ) - def test_invoices_send_post_service_non_namespaced( - 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", - ) - def test_invoices_send_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15305,7 +11611,7 @@ def test_invoices_send_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.send_invoice("in_xxxxxxxxxxxxx") + client.invoices.send_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/send", @@ -15337,7 +11643,7 @@ async def test_invoices_send_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.send_invoice_async("in_xxxxxxxxxxxxx") + await client.invoices.send_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/send", @@ -15345,26 +11651,6 @@ async def test_invoices_send_post_service_async( api_base="https://api.stripe.com", ) - def test_invoices_void_post_service_non_namespaced( - 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", - ) - def test_invoices_void_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15387,7 +11673,7 @@ def test_invoices_void_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.invoices.void_invoice("in_xxxxxxxxxxxxx") + client.invoices.void_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/void", @@ -15419,7 +11705,7 @@ async def test_invoices_void_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.invoices.void_invoice_async("in_xxxxxxxxxxxxx") + await client.invoices.void_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/void", @@ -15427,26 +11713,6 @@ async def test_invoices_void_post_service_async( api_base="https://api.stripe.com", ) - def test_issuing_authorizations_approve_post_service_non_namespaced( - 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", - ) - def test_issuing_authorizations_approve_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15469,7 +11735,7 @@ def test_issuing_authorizations_approve_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.authorizations.approve("iauth_xxxxxxxxxxxxx") + client.issuing.authorizations.approve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", @@ -15501,8 +11767,8 @@ async def test_issuing_authorizations_approve_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.authorizations.approve_async( - "iauth_xxxxxxxxxxxxx", + await client.issuing.authorizations.approve_async( + "iauth_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "post", @@ -15511,26 +11777,6 @@ async def test_issuing_authorizations_approve_post_service_async( api_base="https://api.stripe.com", ) - def test_issuing_authorizations_decline_post_service_non_namespaced( - 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", - ) - def test_issuing_authorizations_decline_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15553,7 +11799,7 @@ def test_issuing_authorizations_decline_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.authorizations.decline("iauth_xxxxxxxxxxxxx") + client.issuing.authorizations.decline("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", @@ -15585,8 +11831,8 @@ async def test_issuing_authorizations_decline_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.authorizations.decline_async( - "iauth_xxxxxxxxxxxxx", + await client.issuing.authorizations.decline_async( + "iauth_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "post", @@ -15595,27 +11841,6 @@ async def test_issuing_authorizations_decline_post_service_async( api_base="https://api.stripe.com", ) - def test_issuing_authorizations_get_service_non_namespaced( - 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", - ) - def test_issuing_authorizations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -15639,7 +11864,7 @@ def test_issuing_authorizations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.authorizations.list({"limit": 3}) + client.issuing.authorizations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations", @@ -15672,7 +11897,7 @@ async def test_issuing_authorizations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.authorizations.list_async({"limit": 3}) + await client.issuing.authorizations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations", @@ -15680,26 +11905,6 @@ async def test_issuing_authorizations_get_service_async( api_base="https://api.stripe.com", ) - def test_issuing_authorizations_get_2_service_non_namespaced( - 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", - ) - def test_issuing_authorizations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -15722,7 +11927,7 @@ def test_issuing_authorizations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.authorizations.retrieve("iauth_xxxxxxxxxxxxx") + client.issuing.authorizations.retrieve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", @@ -15756,7 +11961,7 @@ async def test_issuing_authorizations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.authorizations.retrieve_async( + await client.issuing.authorizations.retrieve_async( "iauth_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -15766,30 +11971,6 @@ async def test_issuing_authorizations_get_2_service_async( api_base="https://api.stripe.com", ) - def test_issuing_authorizations_post_service_non_namespaced( - 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", - ) - def test_issuing_authorizations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -15816,7 +11997,7 @@ def test_issuing_authorizations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.authorizations.update( + client.issuing.authorizations.update( "iauth_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -15856,7 +12037,7 @@ async def test_issuing_authorizations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.authorizations.update_async( + await client.issuing.authorizations.update_async( "iauth_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -15868,27 +12049,6 @@ async def test_issuing_authorizations_post_service_async( post_data="metadata[order_id]=6735", ) - def test_issuing_cardholders_get_service_non_namespaced( - 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", - ) - def test_issuing_cardholders_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -15912,7 +12072,7 @@ def test_issuing_cardholders_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.cardholders.list({"limit": 3}) + client.issuing.cardholders.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders", @@ -15945,7 +12105,7 @@ async def test_issuing_cardholders_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.cardholders.list_async({"limit": 3}) + await client.issuing.cardholders.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders", @@ -15953,26 +12113,6 @@ async def test_issuing_cardholders_get_service_async( api_base="https://api.stripe.com", ) - def test_issuing_cardholders_get_2_service_non_namespaced( - 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", - ) - def test_issuing_cardholders_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -15995,7 +12135,7 @@ def test_issuing_cardholders_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.cardholders.retrieve("ich_xxxxxxxxxxxxx") + client.issuing.cardholders.retrieve("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", @@ -16027,7 +12167,7 @@ async def test_issuing_cardholders_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.cardholders.retrieve_async("ich_xxxxxxxxxxxxx") + await client.issuing.cardholders.retrieve_async("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", @@ -16035,43 +12175,6 @@ async def test_issuing_cardholders_get_2_service_async( api_base="https://api.stripe.com", ) - def test_issuing_cardholders_post_service_non_namespaced( - 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", - ) - def test_issuing_cardholders_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -16109,7 +12212,7 @@ def test_issuing_cardholders_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.cardholders.create( + client.issuing.cardholders.create( { "type": "individual", "name": "Jenny Rosen", @@ -16173,7 +12276,7 @@ async def test_issuing_cardholders_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.cardholders.create_async( + await client.issuing.cardholders.create_async( { "type": "individual", "name": "Jenny Rosen", @@ -16198,30 +12301,6 @@ async def test_issuing_cardholders_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_issuing_cardholders_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -16248,7 +12327,7 @@ def test_issuing_cardholders_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.cardholders.update( + client.issuing.cardholders.update( "ich_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -16288,7 +12367,7 @@ async def test_issuing_cardholders_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.cardholders.update_async( + await client.issuing.cardholders.update_async( "ich_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -16300,27 +12379,6 @@ async def test_issuing_cardholders_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_issuing_cards_get_service_non_namespaced( - 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", - ) - def test_issuing_cards_get(self, http_client_mock: HTTPClientMock) -> None: stripe.issuing.Card.list(limit=3) http_client_mock.assert_requested( @@ -16342,7 +12400,7 @@ def test_issuing_cards_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.cards.list({"limit": 3}) + client.issuing.cards.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cards", @@ -16375,7 +12433,7 @@ async def test_issuing_cards_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.cards.list_async({"limit": 3}) + await client.issuing.cards.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cards", @@ -16383,26 +12441,6 @@ async def test_issuing_cards_get_service_async( api_base="https://api.stripe.com", ) - def test_issuing_cards_get_2_service_non_namespaced( - 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", - ) - def test_issuing_cards_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -16425,7 +12463,7 @@ def test_issuing_cards_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.cards.retrieve("ic_xxxxxxxxxxxxx") + client.issuing.cards.retrieve("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", @@ -16457,7 +12495,7 @@ async def test_issuing_cards_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.cards.retrieve_async("ic_xxxxxxxxxxxxx") + await client.issuing.cards.retrieve_async("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", @@ -16465,33 +12503,6 @@ async def test_issuing_cards_get_2_service_async( api_base="https://api.stripe.com", ) - def test_issuing_cards_post_service_non_namespaced( - 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", - ) - def test_issuing_cards_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -16519,7 +12530,7 @@ def test_issuing_cards_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.cards.create( + client.issuing.cards.create( { "cardholder": "ich_xxxxxxxxxxxxx", "currency": "usd", @@ -16563,7 +12574,7 @@ async def test_issuing_cards_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.cards.create_async( + await client.issuing.cards.create_async( { "cardholder": "ich_xxxxxxxxxxxxx", "currency": "usd", @@ -16578,30 +12589,6 @@ async def test_issuing_cards_post_service_async( post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) - def test_issuing_cards_post_2_service_non_namespaced( - 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", - ) - def test_issuing_cards_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -16628,7 +12615,7 @@ def test_issuing_cards_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.cards.update( + client.issuing.cards.update( "ic_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -16668,7 +12655,7 @@ async def test_issuing_cards_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.cards.update_async( + await client.issuing.cards.update_async( "ic_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -16680,27 +12667,6 @@ async def test_issuing_cards_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_issuing_disputes_get_service_non_namespaced( - 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", - ) - def test_issuing_disputes_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -16724,7 +12690,7 @@ def test_issuing_disputes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.disputes.list({"limit": 3}) + client.issuing.disputes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/disputes", @@ -16757,7 +12723,7 @@ async def test_issuing_disputes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.disputes.list_async({"limit": 3}) + await client.issuing.disputes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/disputes", @@ -16765,26 +12731,6 @@ async def test_issuing_disputes_get_service_async( api_base="https://api.stripe.com", ) - def test_issuing_disputes_get_2_service_non_namespaced( - 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", - ) - def test_issuing_disputes_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -16807,7 +12753,7 @@ def test_issuing_disputes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.disputes.retrieve("idp_xxxxxxxxxxxxx") + client.issuing.disputes.retrieve("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", @@ -16839,7 +12785,7 @@ async def test_issuing_disputes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.disputes.retrieve_async("idp_xxxxxxxxxxxxx") + await client.issuing.disputes.retrieve_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", @@ -16847,37 +12793,6 @@ async def test_issuing_disputes_get_2_service_async( api_base="https://api.stripe.com", ) - def test_issuing_disputes_post_service_non_namespaced( - 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.", - ) - def test_issuing_disputes_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -16907,7 +12822,7 @@ def test_issuing_disputes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.disputes.create( + client.issuing.disputes.create( { "transaction": "ipi_xxxxxxxxxxxxx", "evidence": { @@ -16957,7 +12872,7 @@ async def test_issuing_disputes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.disputes.create_async( + await client.issuing.disputes.create_async( { "transaction": "ipi_xxxxxxxxxxxxx", "evidence": { @@ -16976,26 +12891,6 @@ async def test_issuing_disputes_post_service_async( post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) - def test_issuing_disputes_submit_post_service_non_namespaced( - 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", - ) - def test_issuing_disputes_submit_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -17018,7 +12913,7 @@ def test_issuing_disputes_submit_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.disputes.submit("idp_xxxxxxxxxxxxx") + client.issuing.disputes.submit("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", @@ -17050,7 +12945,7 @@ async def test_issuing_disputes_submit_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.disputes.submit_async("idp_xxxxxxxxxxxxx") + await client.issuing.disputes.submit_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", @@ -17058,26 +12953,6 @@ async def test_issuing_disputes_submit_post_service_async( api_base="https://api.stripe.com", ) - def test_issuing_personalization_designs_get_service_non_namespaced( - 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", - ) - def test_issuing_personalization_designs_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -17100,7 +12975,7 @@ def test_issuing_personalization_designs_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.personalization_designs.list() + client.issuing.personalization_designs.list() http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs", @@ -17132,7 +13007,7 @@ async def test_issuing_personalization_designs_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.personalization_designs.list_async() + await client.issuing.personalization_designs.list_async() http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs", @@ -17140,26 +13015,6 @@ async def test_issuing_personalization_designs_get_service_async( api_base="https://api.stripe.com", ) - def test_issuing_personalization_designs_get_2_service_non_namespaced( - 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", - ) - def test_issuing_personalization_designs_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -17182,7 +13037,7 @@ def test_issuing_personalization_designs_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.personalization_designs.retrieve("pd_xyz") + client.issuing.personalization_designs.retrieve("pd_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs/pd_xyz", @@ -17214,9 +13069,7 @@ async def test_issuing_personalization_designs_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.personalization_designs.retrieve_async( - "pd_xyz" - ) + await client.issuing.personalization_designs.retrieve_async("pd_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs/pd_xyz", @@ -17224,31 +13077,6 @@ async def test_issuing_personalization_designs_get_2_service_async( api_base="https://api.stripe.com", ) - def test_issuing_personalization_designs_post_service_non_namespaced( - 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", - ) - def test_issuing_personalization_designs_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -17272,7 +13100,7 @@ def test_issuing_personalization_designs_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.personalization_designs.create( + client.issuing.personalization_designs.create( { "physical_bundle": "pb_xyz", } @@ -17312,7 +13140,7 @@ async def test_issuing_personalization_designs_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.personalization_designs.create_async( + await client.issuing.personalization_designs.create_async( { "physical_bundle": "pb_xyz", } @@ -17325,26 +13153,6 @@ async def test_issuing_personalization_designs_post_service_async( post_data="physical_bundle=pb_xyz", ) - def test_issuing_personalization_designs_post_2_service_non_namespaced( - 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", - ) - def test_issuing_personalization_designs_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -17367,7 +13175,7 @@ def test_issuing_personalization_designs_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.personalization_designs.update("pd_xyz") + client.issuing.personalization_designs.update("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs/pd_xyz", @@ -17399,7 +13207,7 @@ async def test_issuing_personalization_designs_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.personalization_designs.update_async("pd_xyz") + await client.issuing.personalization_designs.update_async("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs/pd_xyz", @@ -17407,26 +13215,6 @@ async def test_issuing_personalization_designs_post_2_service_async( api_base="https://api.stripe.com", ) - def test_issuing_physical_bundles_get_service_non_namespaced( - 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", - ) - def test_issuing_physical_bundles_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -17449,7 +13237,7 @@ def test_issuing_physical_bundles_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.physical_bundles.list() + client.issuing.physical_bundles.list() http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles", @@ -17481,7 +13269,7 @@ async def test_issuing_physical_bundles_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.physical_bundles.list_async() + await client.issuing.physical_bundles.list_async() http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles", @@ -17489,26 +13277,6 @@ async def test_issuing_physical_bundles_get_service_async( api_base="https://api.stripe.com", ) - def test_issuing_physical_bundles_get_2_service_non_namespaced( - 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", - ) - def test_issuing_physical_bundles_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -17531,7 +13299,7 @@ def test_issuing_physical_bundles_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.physical_bundles.retrieve("pb_xyz") + client.issuing.physical_bundles.retrieve("pb_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles/pb_xyz", @@ -17563,7 +13331,7 @@ async def test_issuing_physical_bundles_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.physical_bundles.retrieve_async("pb_xyz") + await client.issuing.physical_bundles.retrieve_async("pb_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles/pb_xyz", @@ -17571,27 +13339,6 @@ async def test_issuing_physical_bundles_get_2_service_async( api_base="https://api.stripe.com", ) - def test_issuing_transactions_get_service_non_namespaced( - 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", - ) - def test_issuing_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -17615,7 +13362,7 @@ def test_issuing_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.transactions.list({"limit": 3}) + client.issuing.transactions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions", @@ -17648,7 +13395,7 @@ async def test_issuing_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.transactions.list_async({"limit": 3}) + await client.issuing.transactions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions", @@ -17656,26 +13403,6 @@ async def test_issuing_transactions_get_service_async( api_base="https://api.stripe.com", ) - def test_issuing_transactions_get_2_service_non_namespaced( - 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", - ) - def test_issuing_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -17698,7 +13425,7 @@ def test_issuing_transactions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.transactions.retrieve("ipi_xxxxxxxxxxxxx") + client.issuing.transactions.retrieve("ipi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", @@ -17730,9 +13457,7 @@ async def test_issuing_transactions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.issuing.transactions.retrieve_async( - "ipi_xxxxxxxxxxxxx" - ) + await client.issuing.transactions.retrieve_async("ipi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", @@ -17740,7 +13465,21 @@ async def test_issuing_transactions_get_2_service_async( api_base="https://api.stripe.com", ) - def test_issuing_transactions_post_service_non_namespaced( + 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( @@ -17764,10 +13503,11 @@ def test_issuing_transactions_post_service_non_namespaced( post_data="metadata[order_id]=6735", ) - def test_issuing_transactions_post( + @pytest.mark.anyio + async def test_issuing_transactions_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.issuing.Transaction.modify( + await stripe.issuing.Transaction.modify_async( "ipi_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) @@ -17778,7 +13518,8 @@ def test_issuing_transactions_post( post_data="metadata[order_id]=6735", ) - def test_issuing_transactions_post_service( + @pytest.mark.anyio + async def test_issuing_transactions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -17790,7 +13531,7 @@ def test_issuing_transactions_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.issuing.transactions.update( + await client.issuing.transactions.update_async( "ipi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -17802,66 +13543,6 @@ def test_issuing_transactions_post_service( 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.v1.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_service_non_namespaced( - 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", - ) - def test_mandates_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Mandate.retrieve("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -17882,7 +13563,7 @@ def test_mandates_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.mandates.retrieve("mandate_xxxxxxxxxxxxx") + client.mandates.retrieve("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/mandates/mandate_xxxxxxxxxxxxx", @@ -17914,7 +13595,7 @@ async def test_mandates_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.mandates.retrieve_async("mandate_xxxxxxxxxxxxx") + await client.mandates.retrieve_async("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/mandates/mandate_xxxxxxxxxxxxx", @@ -17922,26 +13603,6 @@ async def test_mandates_get_service_async( api_base="https://api.stripe.com", ) - def test_payment_intents_apply_customer_balance_post_service_non_namespaced( - 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", - ) - def test_payment_intents_apply_customer_balance_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -17964,7 +13625,7 @@ def test_payment_intents_apply_customer_balance_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.apply_customer_balance("pi_xxxxxxxxxxxxx") + client.payment_intents.apply_customer_balance("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", @@ -17998,7 +13659,7 @@ async def test_payment_intents_apply_customer_balance_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.apply_customer_balance_async( + await client.payment_intents.apply_customer_balance_async( "pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -18008,26 +13669,6 @@ async def test_payment_intents_apply_customer_balance_post_service_async( api_base="https://api.stripe.com", ) - def test_payment_intents_cancel_post_service_non_namespaced( - 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", - ) - def test_payment_intents_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -18050,7 +13691,7 @@ def test_payment_intents_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.cancel("pi_xxxxxxxxxxxxx") + client.payment_intents.cancel("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", @@ -18082,7 +13723,7 @@ async def test_payment_intents_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.cancel_async("pi_xxxxxxxxxxxxx") + await client.payment_intents.cancel_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", @@ -18090,26 +13731,6 @@ async def test_payment_intents_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_payment_intents_capture_post_service_non_namespaced( - 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", - ) - def test_payment_intents_capture_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -18132,7 +13753,7 @@ def test_payment_intents_capture_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.capture("pi_xxxxxxxxxxxxx") + client.payment_intents.capture("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", @@ -18164,7 +13785,7 @@ async def test_payment_intents_capture_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.capture_async("pi_xxxxxxxxxxxxx") + await client.payment_intents.capture_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", @@ -18172,30 +13793,6 @@ async def test_payment_intents_capture_post_service_async( api_base="https://api.stripe.com", ) - def test_payment_intents_confirm_post_service_non_namespaced( - 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", - ) - def test_payment_intents_confirm_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -18222,7 +13819,7 @@ def test_payment_intents_confirm_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.confirm( + client.payment_intents.confirm( "pi_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) @@ -18262,7 +13859,7 @@ async def test_payment_intents_confirm_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.confirm_async( + await client.payment_intents.confirm_async( "pi_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) @@ -18274,27 +13871,6 @@ async def test_payment_intents_confirm_post_service_async( post_data="payment_method=pm_card_visa", ) - def test_payment_intents_get_service_non_namespaced( - 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", - ) - def test_payment_intents_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -18318,7 +13894,7 @@ def test_payment_intents_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.list({"limit": 3}) + client.payment_intents.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_intents", @@ -18351,7 +13927,7 @@ async def test_payment_intents_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.list_async({"limit": 3}) + await client.payment_intents.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_intents", @@ -18359,26 +13935,6 @@ async def test_payment_intents_get_service_async( api_base="https://api.stripe.com", ) - def test_payment_intents_get_2_service_non_namespaced( - 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", - ) - def test_payment_intents_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -18401,7 +13957,7 @@ def test_payment_intents_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.retrieve("pi_xxxxxxxxxxxxx") + client.payment_intents.retrieve("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", @@ -18433,7 +13989,7 @@ async def test_payment_intents_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.retrieve_async("pi_xxxxxxxxxxxxx") + await client.payment_intents.retrieve_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", @@ -18441,30 +13997,6 @@ async def test_payment_intents_get_2_service_async( api_base="https://api.stripe.com", ) - def test_payment_intents_increment_authorization_post_service_non_namespaced( - 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", - ) - def test_payment_intents_increment_authorization_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -18491,7 +14023,7 @@ def test_payment_intents_increment_authorization_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.increment_authorization( + client.payment_intents.increment_authorization( "pi_xxxxxxxxxxxxx", {"amount": 2099}, ) @@ -18531,7 +14063,7 @@ async def test_payment_intents_increment_authorization_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.increment_authorization_async( + await client.payment_intents.increment_authorization_async( "pi_xxxxxxxxxxxxx", {"amount": 2099}, ) @@ -18543,33 +14075,6 @@ async def test_payment_intents_increment_authorization_post_service_async( post_data="amount=2099", ) - def test_payment_intents_post_service_non_namespaced( - 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", - ) - def test_payment_intents_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -18597,7 +14102,7 @@ def test_payment_intents_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.create( + client.payment_intents.create( { "amount": 1099, "currency": "eur", @@ -18641,7 +14146,7 @@ async def test_payment_intents_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.create_async( + await client.payment_intents.create_async( { "amount": 1099, "currency": "eur", @@ -18656,7 +14161,22 @@ async def test_payment_intents_post_service_async( post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=true", ) - def test_payment_intents_post_2_service_non_namespaced( + 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( @@ -18683,10 +14203,11 @@ def test_payment_intents_post_2_service_non_namespaced( post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=true", ) - def test_payment_intents_post_2( + @pytest.mark.anyio + async def test_payment_intents_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.PaymentIntent.create( + await stripe.PaymentIntent.create_async( amount=2000, currency="usd", automatic_payment_methods={"enabled": True}, @@ -18698,7 +14219,8 @@ def test_payment_intents_post_2( post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=true", ) - def test_payment_intents_post_2_service( + @pytest.mark.anyio + async def test_payment_intents_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -18710,7 +14232,7 @@ def test_payment_intents_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.create( + await client.payment_intents.create_async( { "amount": 2000, "currency": "usd", @@ -18725,74 +14247,6 @@ def test_payment_intents_post_2_service( 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.v1.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_service_non_namespaced( - 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", - ) - def test_payment_intents_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -18819,7 +14273,7 @@ def test_payment_intents_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.update( + client.payment_intents.update( "pi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -18859,7 +14313,7 @@ async def test_payment_intents_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.update_async( + await client.payment_intents.update_async( "pi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -18871,36 +14325,6 @@ async def test_payment_intents_post_3_service_async( post_data="metadata[order_id]=6735", ) - def test_payment_intents_post_4_service_non_namespaced( - 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", - ) - def test_payment_intents_post_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -18928,7 +14352,7 @@ def test_payment_intents_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.create( + client.payment_intents.create( { "amount": 200, "currency": "usd", @@ -18975,7 +14399,7 @@ async def test_payment_intents_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.create_async( + await client.payment_intents.create_async( { "amount": 200, "currency": "usd", @@ -18993,31 +14417,6 @@ async def test_payment_intents_post_4_service_async( post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", ) - def test_payment_intents_search_get_service_non_namespaced( - 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", - ) - def test_payment_intents_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -19043,7 +14442,7 @@ def test_payment_intents_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.search( + client.payment_intents.search( { "query": "status:'succeeded' AND metadata['order_id']:'6735'", } @@ -19082,7 +14481,7 @@ async def test_payment_intents_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.search_async( + await client.payment_intents.search_async( { "query": "status:'succeeded' AND metadata['order_id']:'6735'", } @@ -19094,26 +14493,6 @@ async def test_payment_intents_search_get_service_async( api_base="https://api.stripe.com", ) - def test_payment_intents_verify_microdeposits_post_service_non_namespaced( - 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", - ) - def test_payment_intents_verify_microdeposits_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -19136,7 +14515,7 @@ def test_payment_intents_verify_microdeposits_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.verify_microdeposits("pi_xxxxxxxxxxxxx") + client.payment_intents.verify_microdeposits("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", @@ -19170,7 +14549,7 @@ async def test_payment_intents_verify_microdeposits_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.verify_microdeposits_async( + await client.payment_intents.verify_microdeposits_async( "pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -19180,30 +14559,6 @@ async def test_payment_intents_verify_microdeposits_post_service_async( api_base="https://api.stripe.com", ) - def test_payment_intents_verify_microdeposits_post_2_service_non_namespaced( - 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", - ) - def test_payment_intents_verify_microdeposits_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -19230,7 +14585,7 @@ def test_payment_intents_verify_microdeposits_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_intents.verify_microdeposits( + client.payment_intents.verify_microdeposits( "pi_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) @@ -19270,7 +14625,7 @@ async def test_payment_intents_verify_microdeposits_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_intents.verify_microdeposits_async( + await client.payment_intents.verify_microdeposits_async( "pi_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) @@ -19282,26 +14637,6 @@ async def test_payment_intents_verify_microdeposits_post_2_service_async( post_data="amounts[0]=32&amounts[1]=45", ) - def test_payment_links_get_service_non_namespaced( - 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", - ) - def test_payment_links_get(self, http_client_mock: HTTPClientMock) -> None: stripe.PaymentLink.retrieve("pl_xyz") http_client_mock.assert_requested( @@ -19322,7 +14657,7 @@ def test_payment_links_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_links.retrieve("pl_xyz") + client.payment_links.retrieve("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz", @@ -19354,7 +14689,7 @@ async def test_payment_links_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_links.retrieve_async("pl_xyz") + await client.payment_links.retrieve_async("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz", @@ -19362,27 +14697,6 @@ async def test_payment_links_get_service_async( api_base="https://api.stripe.com", ) - def test_payment_links_get_2_service_non_namespaced( - 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", - ) - def test_payment_links_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -19406,7 +14720,7 @@ def test_payment_links_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_links.list({"limit": 3}) + client.payment_links.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_links", @@ -19439,7 +14753,7 @@ async def test_payment_links_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_links.list_async({"limit": 3}) + await client.payment_links.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_links", @@ -19447,26 +14761,6 @@ async def test_payment_links_get_2_service_async( api_base="https://api.stripe.com", ) - def test_payment_links_get_3_service_non_namespaced( - 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", - ) - def test_payment_links_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -19489,7 +14783,7 @@ def test_payment_links_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_links.retrieve("plink_xxxxxxxxxxxxx") + client.payment_links.retrieve("plink_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_links/plink_xxxxxxxxxxxxx", @@ -19521,7 +14815,7 @@ async def test_payment_links_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_links.retrieve_async("plink_xxxxxxxxxxxxx") + await client.payment_links.retrieve_async("plink_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_links/plink_xxxxxxxxxxxxx", @@ -19529,26 +14823,6 @@ async def test_payment_links_get_3_service_async( api_base="https://api.stripe.com", ) - def test_payment_links_line_items_get_service_non_namespaced( - 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", - ) - def test_payment_links_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -19571,7 +14845,7 @@ def test_payment_links_line_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_links.line_items.list("pl_xyz") + client.payment_links.line_items.list("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz/line_items", @@ -19603,7 +14877,7 @@ async def test_payment_links_line_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_links.line_items.list_async("pl_xyz") + await client.payment_links.line_items.list_async("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz/line_items", @@ -19611,7 +14885,20 @@ async def test_payment_links_line_items_get_service_async( api_base="https://api.stripe.com", ) - def test_payment_links_post_service_non_namespaced( + 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( @@ -19638,46 +14925,6 @@ def test_payment_links_post_service_non_namespaced( post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) - 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.v1.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 @@ -19705,34 +14952,7 @@ async def test_payment_links_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.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_service_non_namespaced( - 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( + await client.payment_links.create_async( { "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} @@ -19772,7 +14992,7 @@ def test_payment_links_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_links.create( + client.payment_links.create( { "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} @@ -19814,7 +15034,7 @@ async def test_payment_links_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_links.create_async( + await client.payment_links.create_async( { "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} @@ -19829,30 +15049,6 @@ async def test_payment_links_post_2_service_async( post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) - def test_payment_links_post_3_service_non_namespaced( - 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", - ) - def test_payment_links_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -19879,7 +15075,7 @@ def test_payment_links_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_links.update( + client.payment_links.update( "plink_xxxxxxxxxxxxx", {"active": False}, ) @@ -19919,7 +15115,7 @@ async def test_payment_links_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_links.update_async( + await client.payment_links.update_async( "plink_xxxxxxxxxxxxx", {"active": False}, ) @@ -19931,27 +15127,6 @@ async def test_payment_links_post_3_service_async( post_data="active=false", ) - def test_payment_method_configurations_get_service_non_namespaced( - 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", - ) - def test_payment_method_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -19975,7 +15150,7 @@ def test_payment_method_configurations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_method_configurations.list({"application": "foo"}) + client.payment_method_configurations.list({"application": "foo"}) http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations", @@ -20008,7 +15183,7 @@ async def test_payment_method_configurations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_method_configurations.list_async( + await client.payment_method_configurations.list_async( { "application": "foo", } @@ -20020,26 +15195,6 @@ async def test_payment_method_configurations_get_service_async( api_base="https://api.stripe.com", ) - def test_payment_method_configurations_get_2_service_non_namespaced( - 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", - ) - def test_payment_method_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -20062,7 +15217,7 @@ def test_payment_method_configurations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_method_configurations.retrieve("foo") + client.payment_method_configurations.retrieve("foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations/foo", @@ -20094,7 +15249,7 @@ async def test_payment_method_configurations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_method_configurations.retrieve_async("foo") + await client.payment_method_configurations.retrieve_async("foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations/foo", @@ -20102,32 +15257,6 @@ async def test_payment_method_configurations_get_2_service_async( api_base="https://api.stripe.com", ) - def test_payment_method_configurations_post_service_non_namespaced( - 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", - ) - def test_payment_method_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -20154,7 +15283,7 @@ def test_payment_method_configurations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_method_configurations.create( + client.payment_method_configurations.create( { "acss_debit": {"display_preference": {"preference": "none"}}, "affirm": {"display_preference": {"preference": "none"}}, @@ -20196,7 +15325,7 @@ async def test_payment_method_configurations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_method_configurations.create_async( + await client.payment_method_configurations.create_async( { "acss_debit": {"display_preference": {"preference": "none"}}, "affirm": {"display_preference": {"preference": "none"}}, @@ -20210,30 +15339,6 @@ async def test_payment_method_configurations_post_service_async( post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", ) - def test_payment_method_configurations_post_2_service_non_namespaced( - 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", - ) - def test_payment_method_configurations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -20260,7 +15365,7 @@ def test_payment_method_configurations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_method_configurations.update( + client.payment_method_configurations.update( "foo", {"acss_debit": {"display_preference": {"preference": "on"}}}, ) @@ -20300,7 +15405,7 @@ async def test_payment_method_configurations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_method_configurations.update_async( + await client.payment_method_configurations.update_async( "foo", {"acss_debit": {"display_preference": {"preference": "on"}}}, ) @@ -20312,30 +15417,6 @@ async def test_payment_method_configurations_post_2_service_async( post_data="acss_debit[display_preference][preference]=on", ) - def test_payment_methods_attach_post_service_non_namespaced( - 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", - ) - def test_payment_methods_attach_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -20362,7 +15443,7 @@ def test_payment_methods_attach_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_methods.attach( + client.payment_methods.attach( "pm_xxxxxxxxxxxxx", {"customer": "cus_xxxxxxxxxxxxx"}, ) @@ -20402,7 +15483,7 @@ async def test_payment_methods_attach_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_methods.attach_async( + await client.payment_methods.attach_async( "pm_xxxxxxxxxxxxx", {"customer": "cus_xxxxxxxxxxxxx"}, ) @@ -20414,26 +15495,6 @@ async def test_payment_methods_attach_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx", ) - def test_payment_methods_detach_post_service_non_namespaced( - 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", - ) - def test_payment_methods_detach_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -20456,7 +15517,7 @@ def test_payment_methods_detach_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_methods.detach("pm_xxxxxxxxxxxxx") + client.payment_methods.detach("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", @@ -20488,7 +15549,7 @@ async def test_payment_methods_detach_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_methods.detach_async("pm_xxxxxxxxxxxxx") + await client.payment_methods.detach_async("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", @@ -20496,32 +15557,6 @@ async def test_payment_methods_detach_post_service_async( api_base="https://api.stripe.com", ) - def test_payment_methods_get_service_non_namespaced( - 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", - ) - def test_payment_methods_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -20548,7 +15583,7 @@ def test_payment_methods_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_methods.list( + client.payment_methods.list( { "customer": "cus_xxxxxxxxxxxxx", "type": "card", @@ -20589,7 +15624,7 @@ async def test_payment_methods_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_methods.list_async( + await client.payment_methods.list_async( { "customer": "cus_xxxxxxxxxxxxx", "type": "card", @@ -20602,26 +15637,6 @@ async def test_payment_methods_get_service_async( api_base="https://api.stripe.com", ) - def test_payment_methods_get_2_service_non_namespaced( - 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", - ) - def test_payment_methods_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -20644,7 +15659,7 @@ def test_payment_methods_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_methods.retrieve("pm_xxxxxxxxxxxxx") + client.payment_methods.retrieve("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", @@ -20676,7 +15691,7 @@ async def test_payment_methods_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_methods.retrieve_async("pm_xxxxxxxxxxxxx") + await client.payment_methods.retrieve_async("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", @@ -20684,37 +15699,6 @@ async def test_payment_methods_get_2_service_async( api_base="https://api.stripe.com", ) - def test_payment_methods_post_service_non_namespaced( - 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", - ) - def test_payment_methods_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -20746,7 +15730,7 @@ def test_payment_methods_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_methods.create( + client.payment_methods.create( { "type": "card", "card": { @@ -20798,7 +15782,7 @@ async def test_payment_methods_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_methods.create_async( + await client.payment_methods.create_async( { "type": "card", "card": { @@ -20817,30 +15801,6 @@ async def test_payment_methods_post_service_async( post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", ) - def test_payment_methods_post_2_service_non_namespaced( - 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", - ) - def test_payment_methods_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -20867,7 +15827,7 @@ def test_payment_methods_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payment_methods.update( + client.payment_methods.update( "pm_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -20907,7 +15867,7 @@ async def test_payment_methods_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payment_methods.update_async( + await client.payment_methods.update_async( "pm_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -20919,26 +15879,6 @@ async def test_payment_methods_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_payouts_cancel_post_service_non_namespaced( - 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", - ) - def test_payouts_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -20961,7 +15901,7 @@ def test_payouts_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payouts.cancel("po_xxxxxxxxxxxxx") + client.payouts.cancel("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", @@ -20993,7 +15933,7 @@ async def test_payouts_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payouts.cancel_async("po_xxxxxxxxxxxxx") + await client.payouts.cancel_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", @@ -21001,27 +15941,6 @@ async def test_payouts_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_payouts_get_service_non_namespaced( - 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", - ) - def test_payouts_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.list(limit=3) http_client_mock.assert_requested( @@ -21043,7 +15962,7 @@ def test_payouts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payouts.list({"limit": 3}) + client.payouts.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payouts", @@ -21076,7 +15995,7 @@ async def test_payouts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payouts.list_async({"limit": 3}) + await client.payouts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payouts", @@ -21084,26 +16003,6 @@ async def test_payouts_get_service_async( api_base="https://api.stripe.com", ) - def test_payouts_get_2_service_non_namespaced( - 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", - ) - def test_payouts_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.retrieve("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -21124,7 +16023,7 @@ def test_payouts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payouts.retrieve("po_xxxxxxxxxxxxx") + client.payouts.retrieve("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payouts/po_xxxxxxxxxxxxx", @@ -21156,7 +16055,7 @@ async def test_payouts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payouts.retrieve_async("po_xxxxxxxxxxxxx") + await client.payouts.retrieve_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payouts/po_xxxxxxxxxxxxx", @@ -21164,27 +16063,6 @@ async def test_payouts_get_2_service_async( api_base="https://api.stripe.com", ) - def test_payouts_post_service_non_namespaced( - 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", - ) - def test_payouts_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.create( amount=1100, @@ -21209,7 +16087,7 @@ def test_payouts_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payouts.create({"amount": 1100, "currency": "usd"}) + client.payouts.create({"amount": 1100, "currency": "usd"}) http_client_mock.assert_requested( "post", path="/v1/payouts", @@ -21246,12 +16124,7 @@ async def test_payouts_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payouts.create_async( - { - "amount": 1100, - "currency": "usd", - } - ) + await client.payouts.create_async({"amount": 1100, "currency": "usd"}) http_client_mock.assert_requested( "post", path="/v1/payouts", @@ -21260,30 +16133,6 @@ async def test_payouts_post_service_async( post_data="amount=1100¤cy=usd", ) - def test_payouts_post_2_service_non_namespaced( - 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", - ) - def test_payouts_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.modify( "po_xxxxxxxxxxxxx", @@ -21308,7 +16157,7 @@ def test_payouts_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payouts.update( + client.payouts.update( "po_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -21348,7 +16197,7 @@ async def test_payouts_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payouts.update_async( + await client.payouts.update_async( "po_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -21360,26 +16209,6 @@ async def test_payouts_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_payouts_reverse_post_service_non_namespaced( - 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", - ) - def test_payouts_reverse_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -21402,7 +16231,7 @@ def test_payouts_reverse_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.payouts.reverse("po_xxxxxxxxxxxxx") + client.payouts.reverse("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", @@ -21434,7 +16263,7 @@ async def test_payouts_reverse_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.payouts.reverse_async("po_xxxxxxxxxxxxx") + await client.payouts.reverse_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", @@ -21442,26 +16271,6 @@ async def test_payouts_reverse_post_service_async( api_base="https://api.stripe.com", ) - def test_plans_delete_service_non_namespaced( - 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", - ) - def test_plans_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.delete("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -21482,7 +16291,7 @@ def test_plans_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.plans.delete("price_xxxxxxxxxxxxx") + client.plans.delete("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/plans/price_xxxxxxxxxxxxx", @@ -21514,7 +16323,7 @@ async def test_plans_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.plans.delete_async("price_xxxxxxxxxxxxx") + await client.plans.delete_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/plans/price_xxxxxxxxxxxxx", @@ -21522,27 +16331,6 @@ async def test_plans_delete_service_async( api_base="https://api.stripe.com", ) - def test_plans_get_service_non_namespaced( - 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", - ) - def test_plans_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.list(limit=3) http_client_mock.assert_requested( @@ -21562,7 +16350,7 @@ def test_plans_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client=http_client_mock.get_mock_http_client(), ) - client.v1.plans.list({"limit": 3}) + client.plans.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/plans", @@ -21595,7 +16383,7 @@ async def test_plans_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.plans.list_async({"limit": 3}) + await client.plans.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/plans", @@ -21603,26 +16391,6 @@ async def test_plans_get_service_async( api_base="https://api.stripe.com", ) - def test_plans_get_2_service_non_namespaced( - 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", - ) - def test_plans_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -21643,7 +16411,7 @@ def test_plans_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.plans.retrieve("price_xxxxxxxxxxxxx") + client.plans.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/plans/price_xxxxxxxxxxxxx", @@ -21675,7 +16443,7 @@ async def test_plans_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.plans.retrieve_async("price_xxxxxxxxxxxxx") + await client.plans.retrieve_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/plans/price_xxxxxxxxxxxxx", @@ -21683,7 +16451,21 @@ async def test_plans_get_2_service_async( api_base="https://api.stripe.com", ) - def test_plans_post_service_non_namespaced( + 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( @@ -21711,48 +16493,6 @@ def test_plans_post_service_non_namespaced( post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) - 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.v1.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 @@ -21783,7 +16523,7 @@ async def test_plans_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.plans.create_async( + await client.plans.create_async( { "amount": 2000, "currency": "usd", @@ -21799,34 +16539,6 @@ async def test_plans_post_service_async( post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) - def test_plans_post_2_service_non_namespaced( - 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", - ) - def test_plans_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.create( amount=2000, @@ -21853,7 +16565,7 @@ def test_plans_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.plans.create( + client.plans.create( { "amount": 2000, "currency": "usd", @@ -21899,7 +16611,7 @@ async def test_plans_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.plans.create_async( + await client.plans.create_async( { "amount": 2000, "currency": "usd", @@ -21915,30 +16627,6 @@ async def test_plans_post_2_service_async( post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", ) - def test_plans_post_3_service_non_namespaced( - 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", - ) - def test_plans_post_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.modify( "price_xxxxxxxxxxxxx", @@ -21963,7 +16651,7 @@ def test_plans_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.plans.update( + client.plans.update( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -22003,7 +16691,7 @@ async def test_plans_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.plans.update_async( + await client.plans.update_async( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -22015,27 +16703,6 @@ async def test_plans_post_3_service_async( post_data="metadata[order_id]=6735", ) - def test_prices_get_service_non_namespaced( - 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", - ) - def test_prices_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.list(limit=3) http_client_mock.assert_requested( @@ -22057,7 +16724,7 @@ def test_prices_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.prices.list({"limit": 3}) + client.prices.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/prices", @@ -22090,7 +16757,7 @@ async def test_prices_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.prices.list_async({"limit": 3}) + await client.prices.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/prices", @@ -22098,26 +16765,6 @@ async def test_prices_get_service_async( api_base="https://api.stripe.com", ) - def test_prices_get_2_service_non_namespaced( - 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", - ) - def test_prices_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -22138,7 +16785,7 @@ def test_prices_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.prices.retrieve("price_xxxxxxxxxxxxx") + client.prices.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/prices/price_xxxxxxxxxxxxx", @@ -22170,7 +16817,7 @@ async def test_prices_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.prices.retrieve_async("price_xxxxxxxxxxxxx") + await client.prices.retrieve_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/prices/price_xxxxxxxxxxxxx", @@ -22178,38 +16825,6 @@ async def test_prices_get_2_service_async( api_base="https://api.stripe.com", ) - def test_prices_post_service_non_namespaced( - 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", - ) - def test_prices_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.create( unit_amount=2000, @@ -22240,7 +16855,7 @@ def test_prices_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.prices.create( + client.prices.create( { "unit_amount": 2000, "currency": "usd", @@ -22294,7 +16909,7 @@ async def test_prices_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.prices.create_async( + await client.prices.create_async( { "unit_amount": 2000, "currency": "usd", @@ -22314,34 +16929,6 @@ async def test_prices_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_prices_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.create( unit_amount=2000, @@ -22368,7 +16955,7 @@ def test_prices_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.prices.create( + client.prices.create( { "unit_amount": 2000, "currency": "usd", @@ -22414,7 +17001,7 @@ async def test_prices_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.prices.create_async( + await client.prices.create_async( { "unit_amount": 2000, "currency": "usd", @@ -22430,30 +17017,6 @@ async def test_prices_post_2_service_async( post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) - def test_prices_post_3_service_non_namespaced( - 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", - ) - def test_prices_post_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.modify( "price_xxxxxxxxxxxxx", @@ -22478,7 +17041,7 @@ def test_prices_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.prices.update( + client.prices.update( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -22518,7 +17081,7 @@ async def test_prices_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.prices.update_async( + await client.prices.update_async( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -22530,31 +17093,6 @@ async def test_prices_post_3_service_async( post_data="metadata[order_id]=6735", ) - def test_prices_search_get_service_non_namespaced( - 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", - ) - def test_prices_search_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.search( query="active:'true' AND metadata['order_id']:'6735'", @@ -22578,7 +17116,7 @@ def test_prices_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.prices.search( + client.prices.search( { "query": "active:'true' AND metadata['order_id']:'6735'", } @@ -22617,7 +17155,7 @@ async def test_prices_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.prices.search_async( + await client.prices.search_async( { "query": "active:'true' AND metadata['order_id']:'6735'", } @@ -22629,26 +17167,6 @@ async def test_prices_search_get_service_async( api_base="https://api.stripe.com", ) - def test_products_delete_service_non_namespaced( - 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", - ) - def test_products_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.delete("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -22669,7 +17187,7 @@ def test_products_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.products.delete("prod_xxxxxxxxxxxxx") + client.products.delete("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/products/prod_xxxxxxxxxxxxx", @@ -22701,7 +17219,7 @@ async def test_products_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.products.delete_async("prod_xxxxxxxxxxxxx") + await client.products.delete_async("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/products/prod_xxxxxxxxxxxxx", @@ -22709,27 +17227,6 @@ async def test_products_delete_service_async( api_base="https://api.stripe.com", ) - def test_products_get_service_non_namespaced( - 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", - ) - def test_products_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.list(limit=3) http_client_mock.assert_requested( @@ -22751,7 +17248,7 @@ def test_products_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.products.list({"limit": 3}) + client.products.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/products", @@ -22784,7 +17281,7 @@ async def test_products_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.products.list_async({"limit": 3}) + await client.products.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/products", @@ -22792,26 +17289,6 @@ async def test_products_get_service_async( api_base="https://api.stripe.com", ) - def test_products_get_2_service_non_namespaced( - 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", - ) - def test_products_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.retrieve("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -22832,7 +17309,7 @@ def test_products_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.products.retrieve("prod_xxxxxxxxxxxxx") + client.products.retrieve("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/products/prod_xxxxxxxxxxxxx", @@ -22864,7 +17341,7 @@ async def test_products_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.products.retrieve_async("prod_xxxxxxxxxxxxx") + await client.products.retrieve_async("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/products/prod_xxxxxxxxxxxxx", @@ -22872,27 +17349,6 @@ async def test_products_get_2_service_async( api_base="https://api.stripe.com", ) - def test_products_post_service_non_namespaced( - 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", - ) - def test_products_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.create(name="Gold Special") http_client_mock.assert_requested( @@ -22914,7 +17370,7 @@ def test_products_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.products.create({"name": "Gold Special"}) + client.products.create({"name": "Gold Special"}) http_client_mock.assert_requested( "post", path="/v1/products", @@ -22948,7 +17404,7 @@ async def test_products_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.products.create_async({"name": "Gold Special"}) + await client.products.create_async({"name": "Gold Special"}) http_client_mock.assert_requested( "post", path="/v1/products", @@ -22957,30 +17413,6 @@ async def test_products_post_service_async( post_data="name=Gold%20Special", ) - def test_products_post_2_service_non_namespaced( - 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", - ) - def test_products_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.modify( "prod_xxxxxxxxxxxxx", @@ -23005,7 +17437,7 @@ def test_products_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.products.update( + client.products.update( "prod_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -23045,7 +17477,7 @@ async def test_products_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.products.update_async( + await client.products.update_async( "prod_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -23057,31 +17489,6 @@ async def test_products_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_products_search_get_service_non_namespaced( - 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", - ) - def test_products_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -23107,7 +17514,7 @@ def test_products_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.products.search( + client.products.search( { "query": "active:'true' AND metadata['order_id']:'6735'", } @@ -23146,7 +17553,7 @@ async def test_products_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.products.search_async( + await client.products.search_async( { "query": "active:'true' AND metadata['order_id']:'6735'", } @@ -23158,27 +17565,6 @@ async def test_products_search_get_service_async( api_base="https://api.stripe.com", ) - def test_promotion_codes_get_service_non_namespaced( - 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", - ) - def test_promotion_codes_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -23202,7 +17588,7 @@ def test_promotion_codes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.promotion_codes.list({"limit": 3}) + client.promotion_codes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/promotion_codes", @@ -23235,7 +17621,7 @@ async def test_promotion_codes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.promotion_codes.list_async({"limit": 3}) + await client.promotion_codes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/promotion_codes", @@ -23243,26 +17629,6 @@ async def test_promotion_codes_get_service_async( api_base="https://api.stripe.com", ) - def test_promotion_codes_get_2_service_non_namespaced( - 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", - ) - def test_promotion_codes_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -23285,7 +17651,7 @@ def test_promotion_codes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.promotion_codes.retrieve("promo_xxxxxxxxxxxxx") + client.promotion_codes.retrieve("promo_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", @@ -23317,7 +17683,7 @@ async def test_promotion_codes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.promotion_codes.retrieve_async("promo_xxxxxxxxxxxxx") + await client.promotion_codes.retrieve_async("promo_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", @@ -23325,27 +17691,6 @@ async def test_promotion_codes_get_2_service_async( api_base="https://api.stripe.com", ) - def test_promotion_codes_post_service_non_namespaced( - 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", - ) - def test_promotion_codes_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -23369,7 +17714,7 @@ def test_promotion_codes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.promotion_codes.create({"coupon": "Z4OV52SU"}) + client.promotion_codes.create({"coupon": "Z4OV52SU"}) http_client_mock.assert_requested( "post", path="/v1/promotion_codes", @@ -23403,7 +17748,7 @@ async def test_promotion_codes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.promotion_codes.create_async({"coupon": "Z4OV52SU"}) + await client.promotion_codes.create_async({"coupon": "Z4OV52SU"}) http_client_mock.assert_requested( "post", path="/v1/promotion_codes", @@ -23412,30 +17757,6 @@ async def test_promotion_codes_post_service_async( post_data="coupon=Z4OV52SU", ) - def test_promotion_codes_post_2_service_non_namespaced( - 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", - ) - def test_promotion_codes_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -23462,7 +17783,7 @@ def test_promotion_codes_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.promotion_codes.update( + client.promotion_codes.update( "promo_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -23502,7 +17823,7 @@ async def test_promotion_codes_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.promotion_codes.update_async( + await client.promotion_codes.update_async( "promo_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -23514,26 +17835,6 @@ async def test_promotion_codes_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_quotes_accept_post_service_non_namespaced( - 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", - ) - def test_quotes_accept_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -23556,7 +17857,7 @@ def test_quotes_accept_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.quotes.accept("qt_xxxxxxxxxxxxx") + client.quotes.accept("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", @@ -23588,7 +17889,7 @@ async def test_quotes_accept_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.quotes.accept_async("qt_xxxxxxxxxxxxx") + await client.quotes.accept_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", @@ -23596,26 +17897,6 @@ async def test_quotes_accept_post_service_async( api_base="https://api.stripe.com", ) - def test_quotes_cancel_post_service_non_namespaced( - 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", - ) - def test_quotes_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -23638,7 +17919,7 @@ def test_quotes_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.quotes.cancel("qt_xxxxxxxxxxxxx") + client.quotes.cancel("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", @@ -23670,7 +17951,7 @@ async def test_quotes_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.quotes.cancel_async("qt_xxxxxxxxxxxxx") + await client.quotes.cancel_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", @@ -23678,26 +17959,6 @@ async def test_quotes_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_quotes_finalize_post_service_non_namespaced( - 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", - ) - def test_quotes_finalize_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -23720,7 +17981,7 @@ def test_quotes_finalize_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.quotes.finalize_quote("qt_xxxxxxxxxxxxx") + client.quotes.finalize_quote("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", @@ -23752,7 +18013,7 @@ async def test_quotes_finalize_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.quotes.finalize_quote_async("qt_xxxxxxxxxxxxx") + await client.quotes.finalize_quote_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", @@ -23760,27 +18021,6 @@ async def test_quotes_finalize_post_service_async( api_base="https://api.stripe.com", ) - def test_quotes_get_service_non_namespaced( - 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", - ) - def test_quotes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.list(limit=3) http_client_mock.assert_requested( @@ -23802,7 +18042,7 @@ def test_quotes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.quotes.list({"limit": 3}) + client.quotes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/quotes", @@ -23835,7 +18075,7 @@ async def test_quotes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.quotes.list_async({"limit": 3}) + await client.quotes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/quotes", @@ -23843,26 +18083,6 @@ async def test_quotes_get_service_async( api_base="https://api.stripe.com", ) - def test_quotes_get_2_service_non_namespaced( - 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", - ) - def test_quotes_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.retrieve("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -23883,7 +18103,7 @@ def test_quotes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.quotes.retrieve("qt_xxxxxxxxxxxxx") + client.quotes.retrieve("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx", @@ -23915,7 +18135,7 @@ async def test_quotes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.quotes.retrieve_async("qt_xxxxxxxxxxxxx") + await client.quotes.retrieve_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx", @@ -23923,26 +18143,6 @@ async def test_quotes_get_2_service_async( api_base="https://api.stripe.com", ) - def test_quotes_line_items_get_service_non_namespaced( - 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", - ) - def test_quotes_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -23965,7 +18165,7 @@ def test_quotes_line_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.quotes.line_items.list("qt_xxxxxxxxxxxxx") + client.quotes.line_items.list("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", @@ -23997,7 +18197,7 @@ async def test_quotes_line_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.quotes.line_items.list_async("qt_xxxxxxxxxxxxx") + await client.quotes.line_items.list_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", @@ -24005,26 +18205,6 @@ async def test_quotes_line_items_get_service_async( api_base="https://api.stripe.com", ) - def test_quotes_pdf_get_service_non_namespaced( - 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", - ) - def test_quotes_pdf_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.pdf("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -24045,7 +18225,7 @@ def test_quotes_pdf_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.quotes.pdf("qt_xxxxxxxxxxxxx") + client.quotes.pdf("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", @@ -24077,7 +18257,7 @@ async def test_quotes_pdf_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.quotes.pdf_async("qt_xxxxxxxxxxxxx") + await client.quotes.pdf_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", @@ -24085,34 +18265,6 @@ async def test_quotes_pdf_get_service_async( api_base="https://files.stripe.com", ) - def test_quotes_post_service_non_namespaced( - 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", - ) - def test_quotes_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.create( customer="cus_xxxxxxxxxxxxx", @@ -24137,7 +18289,7 @@ def test_quotes_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.quotes.create( + client.quotes.create( { "customer": "cus_xxxxxxxxxxxxx", "line_items": [ @@ -24181,7 +18333,7 @@ async def test_quotes_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.quotes.create_async( + await client.quotes.create_async( { "customer": "cus_xxxxxxxxxxxxx", "line_items": [ @@ -24197,30 +18349,6 @@ async def test_quotes_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", ) - def test_quotes_post_2_service_non_namespaced( - 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", - ) - def test_quotes_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.modify( "qt_xxxxxxxxxxxxx", @@ -24245,7 +18373,7 @@ def test_quotes_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.quotes.update( + client.quotes.update( "qt_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -24285,7 +18413,7 @@ async def test_quotes_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.quotes.update_async( + await client.quotes.update_async( "qt_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -24297,27 +18425,6 @@ async def test_quotes_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_radar_early_fraud_warnings_get_service_non_namespaced( - 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", - ) - def test_radar_early_fraud_warnings_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -24341,7 +18448,7 @@ def test_radar_early_fraud_warnings_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.early_fraud_warnings.list({"limit": 3}) + client.radar.early_fraud_warnings.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings", @@ -24374,7 +18481,7 @@ async def test_radar_early_fraud_warnings_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.early_fraud_warnings.list_async({"limit": 3}) + await client.radar.early_fraud_warnings.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings", @@ -24382,26 +18489,6 @@ async def test_radar_early_fraud_warnings_get_service_async( api_base="https://api.stripe.com", ) - def test_radar_early_fraud_warnings_get_2_service_non_namespaced( - 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", - ) - def test_radar_early_fraud_warnings_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -24424,7 +18511,7 @@ def test_radar_early_fraud_warnings_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.early_fraud_warnings.retrieve("issfr_xxxxxxxxxxxxx") + client.radar.early_fraud_warnings.retrieve("issfr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", @@ -24458,7 +18545,7 @@ async def test_radar_early_fraud_warnings_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.early_fraud_warnings.retrieve_async( + await client.radar.early_fraud_warnings.retrieve_async( "issfr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -24468,26 +18555,6 @@ async def test_radar_early_fraud_warnings_get_2_service_async( api_base="https://api.stripe.com", ) - def test_radar_value_list_items_delete_service_non_namespaced( - 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", - ) - def test_radar_value_list_items_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -24510,7 +18577,7 @@ def test_radar_value_list_items_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.value_list_items.delete("rsli_xxxxxxxxxxxxx") + client.radar.value_list_items.delete("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", @@ -24542,9 +18609,7 @@ async def test_radar_value_list_items_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.value_list_items.delete_async( - "rsli_xxxxxxxxxxxxx", - ) + await client.radar.value_list_items.delete_async("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", @@ -24552,32 +18617,6 @@ async def test_radar_value_list_items_delete_service_async( api_base="https://api.stripe.com", ) - def test_radar_value_list_items_get_service_non_namespaced( - 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", - ) - def test_radar_value_list_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -24604,7 +18643,7 @@ def test_radar_value_list_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.value_list_items.list( + client.radar.value_list_items.list( { "limit": 3, "value_list": "rsl_xxxxxxxxxxxxx", @@ -24645,7 +18684,7 @@ async def test_radar_value_list_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.value_list_items.list_async( + await client.radar.value_list_items.list_async( { "limit": 3, "value_list": "rsl_xxxxxxxxxxxxx", @@ -24658,26 +18697,6 @@ async def test_radar_value_list_items_get_service_async( api_base="https://api.stripe.com", ) - def test_radar_value_list_items_get_2_service_non_namespaced( - 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", - ) - def test_radar_value_list_items_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -24700,7 +18719,7 @@ def test_radar_value_list_items_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.value_list_items.retrieve("rsli_xxxxxxxxxxxxx") + client.radar.value_list_items.retrieve("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", @@ -24732,8 +18751,8 @@ async def test_radar_value_list_items_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.value_list_items.retrieve_async( - "rsli_xxxxxxxxxxxxx", + await client.radar.value_list_items.retrieve_async( + "rsli_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", @@ -24742,7 +18761,21 @@ async def test_radar_value_list_items_get_2_service_async( api_base="https://api.stripe.com", ) - def test_radar_value_list_items_post_service_non_namespaced( + 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( @@ -24768,10 +18801,11 @@ def test_radar_value_list_items_post_service_non_namespaced( post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", ) - def test_radar_value_list_items_post( + @pytest.mark.anyio + async def test_radar_value_list_items_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.radar.ValueListItem.create( + await stripe.radar.ValueListItem.create_async( value_list="rsl_xxxxxxxxxxxxx", value="1.2.3.4", ) @@ -24782,7 +18816,8 @@ def test_radar_value_list_items_post( post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", ) - def test_radar_value_list_items_post_service( + @pytest.mark.anyio + async def test_radar_value_list_items_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -24794,7 +18829,7 @@ def test_radar_value_list_items_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.value_list_items.create( + await client.radar.value_list_items.create_async( { "value_list": "rsl_xxxxxxxxxxxxx", "value": "1.2.3.4", @@ -24808,68 +18843,6 @@ def test_radar_value_list_items_post_service( 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.v1.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_service_non_namespaced( - 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", - ) - def test_radar_value_lists_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -24892,7 +18865,7 @@ def test_radar_value_lists_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.value_lists.delete("rsl_xxxxxxxxxxxxx") + client.radar.value_lists.delete("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", @@ -24924,7 +18897,7 @@ async def test_radar_value_lists_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.value_lists.delete_async("rsl_xxxxxxxxxxxxx") + await client.radar.value_lists.delete_async("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", @@ -24932,27 +18905,6 @@ async def test_radar_value_lists_delete_service_async( api_base="https://api.stripe.com", ) - def test_radar_value_lists_get_service_non_namespaced( - 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", - ) - def test_radar_value_lists_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -24976,7 +18928,7 @@ def test_radar_value_lists_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.value_lists.list({"limit": 3}) + client.radar.value_lists.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/value_lists", @@ -25009,7 +18961,7 @@ async def test_radar_value_lists_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.value_lists.list_async({"limit": 3}) + await client.radar.value_lists.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/value_lists", @@ -25017,26 +18969,6 @@ async def test_radar_value_lists_get_service_async( api_base="https://api.stripe.com", ) - def test_radar_value_lists_get_2_service_non_namespaced( - 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", - ) - def test_radar_value_lists_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -25059,7 +18991,7 @@ def test_radar_value_lists_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.value_lists.retrieve("rsl_xxxxxxxxxxxxx") + client.radar.value_lists.retrieve("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", @@ -25091,7 +19023,7 @@ async def test_radar_value_lists_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.value_lists.retrieve_async("rsl_xxxxxxxxxxxxx") + await client.radar.value_lists.retrieve_async("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", @@ -25099,33 +19031,6 @@ async def test_radar_value_lists_get_2_service_async( api_base="https://api.stripe.com", ) - def test_radar_value_lists_post_service_non_namespaced( - 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", - ) - def test_radar_value_lists_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -25153,7 +19058,7 @@ def test_radar_value_lists_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.value_lists.create( + client.radar.value_lists.create( { "alias": "custom_ip_xxxxxxxxxxxxx", "name": "Custom IP Blocklist", @@ -25197,7 +19102,7 @@ async def test_radar_value_lists_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.value_lists.create_async( + await client.radar.value_lists.create_async( { "alias": "custom_ip_xxxxxxxxxxxxx", "name": "Custom IP Blocklist", @@ -25212,30 +19117,6 @@ async def test_radar_value_lists_post_service_async( post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", ) - def test_radar_value_lists_post_2_service_non_namespaced( - 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", - ) - def test_radar_value_lists_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -25262,7 +19143,7 @@ def test_radar_value_lists_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.radar.value_lists.update( + client.radar.value_lists.update( "rsl_xxxxxxxxxxxxx", {"name": "Updated IP Block List"}, ) @@ -25302,7 +19183,7 @@ async def test_radar_value_lists_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.radar.value_lists.update_async( + await client.radar.value_lists.update_async( "rsl_xxxxxxxxxxxxx", {"name": "Updated IP Block List"}, ) @@ -25314,26 +19195,6 @@ async def test_radar_value_lists_post_2_service_async( post_data="name=Updated%20IP%20Block%20List", ) - def test_refunds_cancel_post_service_non_namespaced( - 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", - ) - def test_refunds_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -25356,7 +19217,7 @@ def test_refunds_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.refunds.cancel("re_xxxxxxxxxxxxx") + client.refunds.cancel("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", @@ -25388,7 +19249,7 @@ async def test_refunds_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.refunds.cancel_async("re_xxxxxxxxxxxxx") + await client.refunds.cancel_async("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", @@ -25396,27 +19257,6 @@ async def test_refunds_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_refunds_get_service_non_namespaced( - 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", - ) - def test_refunds_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.list(limit=3) http_client_mock.assert_requested( @@ -25438,7 +19278,7 @@ def test_refunds_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.refunds.list({"limit": 3}) + client.refunds.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/refunds", @@ -25471,7 +19311,7 @@ async def test_refunds_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.refunds.list_async({"limit": 3}) + await client.refunds.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/refunds", @@ -25479,26 +19319,6 @@ async def test_refunds_get_service_async( api_base="https://api.stripe.com", ) - def test_refunds_get_2_service_non_namespaced( - 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", - ) - def test_refunds_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.retrieve("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -25519,7 +19339,7 @@ def test_refunds_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.refunds.retrieve("re_xxxxxxxxxxxxx") + client.refunds.retrieve("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/refunds/re_xxxxxxxxxxxxx", @@ -25551,7 +19371,7 @@ async def test_refunds_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.refunds.retrieve_async("re_xxxxxxxxxxxxx") + await client.refunds.retrieve_async("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/refunds/re_xxxxxxxxxxxxx", @@ -25559,27 +19379,6 @@ async def test_refunds_get_2_service_async( api_base="https://api.stripe.com", ) - def test_refunds_post_service_non_namespaced( - 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", - ) - def test_refunds_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.create(charge="ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -25601,7 +19400,7 @@ def test_refunds_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.refunds.create({"charge": "ch_xxxxxxxxxxxxx"}) + client.refunds.create({"charge": "ch_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/refunds", @@ -25635,7 +19434,7 @@ async def test_refunds_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.refunds.create_async({"charge": "ch_xxxxxxxxxxxxx"}) + await client.refunds.create_async({"charge": "ch_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/refunds", @@ -25644,7 +19443,19 @@ async def test_refunds_post_service_async( post_data="charge=ch_xxxxxxxxxxxxx", ) - def test_refunds_post_2_service_non_namespaced( + 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( @@ -25668,8 +19479,11 @@ def test_refunds_post_2_service_non_namespaced( post_data="metadata[order_id]=6735", ) - def test_refunds_post_2(self, http_client_mock: HTTPClientMock) -> None: - stripe.Refund.modify( + @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"}, ) @@ -25680,7 +19494,8 @@ def test_refunds_post_2(self, http_client_mock: HTTPClientMock) -> None: post_data="metadata[order_id]=6735", ) - def test_refunds_post_2_service( + @pytest.mark.anyio + async def test_refunds_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -25692,7 +19507,7 @@ def test_refunds_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.refunds.update( + await client.refunds.update_async( "re_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -25704,67 +19519,6 @@ def test_refunds_post_2_service( 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.v1.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_service_non_namespaced( - 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", - ) - def test_reporting_report_runs_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -25788,7 +19542,7 @@ def test_reporting_report_runs_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.reporting.report_runs.list({"limit": 3}) + client.reporting.report_runs.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs", @@ -25821,7 +19575,7 @@ async def test_reporting_report_runs_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.reporting.report_runs.list_async({"limit": 3}) + await client.reporting.report_runs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs", @@ -25829,26 +19583,6 @@ async def test_reporting_report_runs_get_service_async( api_base="https://api.stripe.com", ) - def test_reporting_report_runs_get_2_service_non_namespaced( - 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", - ) - def test_reporting_report_runs_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -25871,7 +19605,7 @@ def test_reporting_report_runs_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.reporting.report_runs.retrieve("frr_xxxxxxxxxxxxx") + client.reporting.report_runs.retrieve("frr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", @@ -25903,9 +19637,7 @@ async def test_reporting_report_runs_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.reporting.report_runs.retrieve_async( - "frr_xxxxxxxxxxxxx", - ) + await client.reporting.report_runs.retrieve_async("frr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", @@ -25913,35 +19645,6 @@ async def test_reporting_report_runs_get_2_service_async( api_base="https://api.stripe.com", ) - def test_reporting_report_runs_post_service_non_namespaced( - 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", - ) - def test_reporting_report_runs_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -25971,7 +19674,7 @@ def test_reporting_report_runs_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.reporting.report_runs.create( + client.reporting.report_runs.create( { "report_type": "balance.summary.1", "parameters": { @@ -26019,7 +19722,7 @@ async def test_reporting_report_runs_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.reporting.report_runs.create_async( + await client.reporting.report_runs.create_async( { "report_type": "balance.summary.1", "parameters": { @@ -26036,26 +19739,6 @@ async def test_reporting_report_runs_post_service_async( post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", ) - def test_reporting_report_types_get_service_non_namespaced( - 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", - ) - def test_reporting_report_types_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -26078,7 +19761,7 @@ def test_reporting_report_types_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.reporting.report_types.list() + client.reporting.report_types.list() http_client_mock.assert_requested( "get", path="/v1/reporting/report_types", @@ -26110,7 +19793,7 @@ async def test_reporting_report_types_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.reporting.report_types.list_async() + await client.reporting.report_types.list_async() http_client_mock.assert_requested( "get", path="/v1/reporting/report_types", @@ -26118,26 +19801,6 @@ async def test_reporting_report_types_get_service_async( api_base="https://api.stripe.com", ) - def test_reporting_report_types_get_2_service_non_namespaced( - 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", - ) - def test_reporting_report_types_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -26160,7 +19823,7 @@ def test_reporting_report_types_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.reporting.report_types.retrieve("balance.summary.1") + client.reporting.report_types.retrieve("balance.summary.1") http_client_mock.assert_requested( "get", path="/v1/reporting/report_types/balance.summary.1", @@ -26192,9 +19855,7 @@ async def test_reporting_report_types_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.reporting.report_types.retrieve_async( - "balance.summary.1", - ) + await client.reporting.report_types.retrieve_async("balance.summary.1") http_client_mock.assert_requested( "get", path="/v1/reporting/report_types/balance.summary.1", @@ -26202,26 +19863,6 @@ async def test_reporting_report_types_get_2_service_async( api_base="https://api.stripe.com", ) - def test_reviews_approve_post_service_non_namespaced( - 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", - ) - def test_reviews_approve_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26244,7 +19885,7 @@ def test_reviews_approve_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.reviews.approve("prv_xxxxxxxxxxxxx") + client.reviews.approve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", @@ -26276,7 +19917,7 @@ async def test_reviews_approve_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.reviews.approve_async("prv_xxxxxxxxxxxxx") + await client.reviews.approve_async("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", @@ -26284,27 +19925,6 @@ async def test_reviews_approve_post_service_async( api_base="https://api.stripe.com", ) - def test_reviews_get_service_non_namespaced( - 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", - ) - def test_reviews_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Review.list(limit=3) http_client_mock.assert_requested( @@ -26326,7 +19946,7 @@ def test_reviews_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.reviews.list({"limit": 3}) + client.reviews.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reviews", @@ -26359,7 +19979,7 @@ async def test_reviews_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.reviews.list_async({"limit": 3}) + await client.reviews.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reviews", @@ -26367,26 +19987,6 @@ async def test_reviews_get_service_async( api_base="https://api.stripe.com", ) - def test_reviews_get_2_service_non_namespaced( - 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", - ) - def test_reviews_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Review.retrieve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -26407,7 +20007,7 @@ def test_reviews_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.reviews.retrieve("prv_xxxxxxxxxxxxx") + client.reviews.retrieve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reviews/prv_xxxxxxxxxxxxx", @@ -26439,7 +20039,7 @@ async def test_reviews_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.reviews.retrieve_async("prv_xxxxxxxxxxxxx") + await client.reviews.retrieve_async("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reviews/prv_xxxxxxxxxxxxx", @@ -26447,27 +20047,6 @@ async def test_reviews_get_2_service_async( api_base="https://api.stripe.com", ) - def test_setup_attempts_get_service_non_namespaced( - 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", - ) - def test_setup_attempts_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -26494,7 +20073,7 @@ def test_setup_attempts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.setup_attempts.list({"limit": 3, "setup_intent": "si_xyz"}) + client.setup_attempts.list({"limit": 3, "setup_intent": "si_xyz"}) http_client_mock.assert_requested( "get", path="/v1/setup_attempts", @@ -26530,7 +20109,7 @@ async def test_setup_attempts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.setup_attempts.list_async( + await client.setup_attempts.list_async( { "limit": 3, "setup_intent": "si_xyz", @@ -26543,26 +20122,6 @@ async def test_setup_attempts_get_service_async( api_base="https://api.stripe.com", ) - def test_setup_intents_cancel_post_service_non_namespaced( - 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", - ) - def test_setup_intents_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26585,7 +20144,7 @@ def test_setup_intents_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.setup_intents.cancel("seti_xxxxxxxxxxxxx") + client.setup_intents.cancel("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", @@ -26617,7 +20176,7 @@ async def test_setup_intents_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.setup_intents.cancel_async("seti_xxxxxxxxxxxxx") + await client.setup_intents.cancel_async("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", @@ -26625,7 +20184,21 @@ async def test_setup_intents_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_setup_intents_confirm_post_service_non_namespaced( + 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( @@ -26649,44 +20222,6 @@ def test_setup_intents_confirm_post_service_non_namespaced( post_data="payment_method=pm_card_visa", ) - 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.v1.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 @@ -26715,7 +20250,7 @@ async def test_setup_intents_confirm_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.setup_intents.confirm_async( + await client.setup_intents.confirm_async( "seti_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) @@ -26727,27 +20262,6 @@ async def test_setup_intents_confirm_post_service_async( post_data="payment_method=pm_card_visa", ) - def test_setup_intents_get_service_non_namespaced( - 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", - ) - def test_setup_intents_get(self, http_client_mock: HTTPClientMock) -> None: stripe.SetupIntent.list(limit=3) http_client_mock.assert_requested( @@ -26769,7 +20283,7 @@ def test_setup_intents_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.setup_intents.list({"limit": 3}) + client.setup_intents.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/setup_intents", @@ -26802,7 +20316,7 @@ async def test_setup_intents_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.setup_intents.list_async({"limit": 3}) + await client.setup_intents.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/setup_intents", @@ -26810,26 +20324,6 @@ async def test_setup_intents_get_service_async( api_base="https://api.stripe.com", ) - def test_setup_intents_get_2_service_non_namespaced( - 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", - ) - def test_setup_intents_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -26852,7 +20346,7 @@ def test_setup_intents_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.setup_intents.retrieve("seti_xxxxxxxxxxxxx") + client.setup_intents.retrieve("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", @@ -26884,7 +20378,7 @@ async def test_setup_intents_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.setup_intents.retrieve_async("seti_xxxxxxxxxxxxx") + await client.setup_intents.retrieve_async("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", @@ -26892,27 +20386,6 @@ async def test_setup_intents_get_2_service_async( api_base="https://api.stripe.com", ) - def test_setup_intents_post_service_non_namespaced( - 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", - ) - def test_setup_intents_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -26936,7 +20409,7 @@ def test_setup_intents_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.setup_intents.create({"payment_method_types": ["card"]}) + client.setup_intents.create({"payment_method_types": ["card"]}) http_client_mock.assert_requested( "post", path="/v1/setup_intents", @@ -26970,7 +20443,7 @@ async def test_setup_intents_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.setup_intents.create_async( + await client.setup_intents.create_async( { "payment_method_types": ["card"], } @@ -26983,30 +20456,6 @@ async def test_setup_intents_post_service_async( post_data="payment_method_types[0]=card", ) - def test_setup_intents_post_2_service_non_namespaced( - 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", - ) - def test_setup_intents_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -27033,7 +20482,7 @@ def test_setup_intents_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.setup_intents.update( + client.setup_intents.update( "seti_xxxxxxxxxxxxx", {"metadata": {"user_id": "3435453"}}, ) @@ -27073,7 +20522,7 @@ async def test_setup_intents_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.setup_intents.update_async( + await client.setup_intents.update_async( "seti_xxxxxxxxxxxxx", {"metadata": {"user_id": "3435453"}}, ) @@ -27085,26 +20534,6 @@ async def test_setup_intents_post_2_service_async( post_data="metadata[user_id]=3435453", ) - def test_setup_intents_verify_microdeposits_post_service_non_namespaced( - 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", - ) - def test_setup_intents_verify_microdeposits_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -27127,7 +20556,7 @@ def test_setup_intents_verify_microdeposits_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.setup_intents.verify_microdeposits("seti_xxxxxxxxxxxxx") + client.setup_intents.verify_microdeposits("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", @@ -27161,38 +20590,14 @@ async def test_setup_intents_verify_microdeposits_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.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_service_non_namespaced( - 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( + 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_setup_intents_verify_microdeposits_post_2( @@ -27221,7 +20626,7 @@ def test_setup_intents_verify_microdeposits_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.setup_intents.verify_microdeposits( + client.setup_intents.verify_microdeposits( "seti_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) @@ -27261,7 +20666,7 @@ async def test_setup_intents_verify_microdeposits_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.setup_intents.verify_microdeposits_async( + await client.setup_intents.verify_microdeposits_async( "seti_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) @@ -27273,26 +20678,6 @@ async def test_setup_intents_verify_microdeposits_post_2_service_async( post_data="amounts[0]=32&amounts[1]=45", ) - def test_shipping_rates_get_service_non_namespaced( - 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", - ) - def test_shipping_rates_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -27315,7 +20700,7 @@ def test_shipping_rates_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.shipping_rates.list() + client.shipping_rates.list() http_client_mock.assert_requested( "get", path="/v1/shipping_rates", @@ -27347,7 +20732,7 @@ async def test_shipping_rates_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.shipping_rates.list_async() + await client.shipping_rates.list_async() http_client_mock.assert_requested( "get", path="/v1/shipping_rates", @@ -27355,27 +20740,6 @@ async def test_shipping_rates_get_service_async( api_base="https://api.stripe.com", ) - def test_shipping_rates_get_2_service_non_namespaced( - 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", - ) - def test_shipping_rates_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -27399,7 +20763,7 @@ def test_shipping_rates_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.shipping_rates.list({"limit": 3}) + client.shipping_rates.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/shipping_rates", @@ -27432,7 +20796,7 @@ async def test_shipping_rates_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.shipping_rates.list_async({"limit": 3}) + await client.shipping_rates.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/shipping_rates", @@ -27440,26 +20804,6 @@ async def test_shipping_rates_get_2_service_async( api_base="https://api.stripe.com", ) - def test_shipping_rates_get_3_service_non_namespaced( - 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", - ) - def test_shipping_rates_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -27482,7 +20826,7 @@ def test_shipping_rates_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.shipping_rates.retrieve("shr_xxxxxxxxxxxxx") + client.shipping_rates.retrieve("shr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", @@ -27514,7 +20858,7 @@ async def test_shipping_rates_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.shipping_rates.retrieve_async("shr_xxxxxxxxxxxxx") + await client.shipping_rates.retrieve_async("shr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", @@ -27522,33 +20866,6 @@ async def test_shipping_rates_get_3_service_async( api_base="https://api.stripe.com", ) - def test_shipping_rates_post_service_non_namespaced( - 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", - ) - def test_shipping_rates_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -27576,7 +20893,7 @@ def test_shipping_rates_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.shipping_rates.create( + client.shipping_rates.create( { "display_name": "Sample Shipper", "fixed_amount": {"currency": "usd", "amount": 400}, @@ -27620,7 +20937,7 @@ async def test_shipping_rates_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.shipping_rates.create_async( + await client.shipping_rates.create_async( { "display_name": "Sample Shipper", "fixed_amount": {"currency": "usd", "amount": 400}, @@ -27635,7 +20952,22 @@ async def test_shipping_rates_post_service_async( post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", ) - def test_shipping_rates_post_2_service_non_namespaced( + 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( @@ -27662,48 +20994,6 @@ def test_shipping_rates_post_2_service_non_namespaced( post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", ) - 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.v1.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 @@ -27733,7 +21023,7 @@ async def test_shipping_rates_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.shipping_rates.create_async( + await client.shipping_rates.create_async( { "display_name": "Ground shipping", "type": "fixed_amount", @@ -27748,30 +21038,6 @@ async def test_shipping_rates_post_2_service_async( post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", ) - def test_shipping_rates_post_3_service_non_namespaced( - 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", - ) - def test_shipping_rates_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -27798,7 +21064,7 @@ def test_shipping_rates_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.shipping_rates.update( + client.shipping_rates.update( "shr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -27838,7 +21104,7 @@ async def test_shipping_rates_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.shipping_rates.update_async( + await client.shipping_rates.update_async( "shr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -27850,27 +21116,6 @@ async def test_shipping_rates_post_3_service_async( post_data="metadata[order_id]=6735", ) - def test_sigma_scheduled_query_runs_get_service_non_namespaced( - 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", - ) - def test_sigma_scheduled_query_runs_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -27894,7 +21139,7 @@ def test_sigma_scheduled_query_runs_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.sigma.scheduled_query_runs.list({"limit": 3}) + client.sigma.scheduled_query_runs.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs", @@ -27927,7 +21172,7 @@ async def test_sigma_scheduled_query_runs_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.sigma.scheduled_query_runs.list_async({"limit": 3}) + await client.sigma.scheduled_query_runs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs", @@ -27935,26 +21180,6 @@ async def test_sigma_scheduled_query_runs_get_service_async( api_base="https://api.stripe.com", ) - def test_sigma_scheduled_query_runs_get_2_service_non_namespaced( - 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", - ) - def test_sigma_scheduled_query_runs_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -27977,7 +21202,7 @@ def test_sigma_scheduled_query_runs_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.sigma.scheduled_query_runs.retrieve("sqr_xxxxxxxxxxxxx") + client.sigma.scheduled_query_runs.retrieve("sqr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", @@ -28011,7 +21236,7 @@ async def test_sigma_scheduled_query_runs_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.sigma.scheduled_query_runs.retrieve_async( + await client.sigma.scheduled_query_runs.retrieve_async( "sqr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -28021,26 +21246,6 @@ async def test_sigma_scheduled_query_runs_get_2_service_async( api_base="https://api.stripe.com", ) - def test_sources_get_service_non_namespaced( - 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", - ) - def test_sources_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Source.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -28061,7 +21266,7 @@ def test_sources_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.sources.retrieve("src_xxxxxxxxxxxxx") + client.sources.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", @@ -28093,27 +21298,7 @@ async def test_sources_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.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_service_non_namespaced( - 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") + await client.sources.retrieve_async("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", @@ -28141,7 +21326,7 @@ def test_sources_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.sources.retrieve("src_xxxxxxxxxxxxx") + client.sources.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", @@ -28173,7 +21358,7 @@ async def test_sources_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.sources.retrieve_async("src_xxxxxxxxxxxxx") + await client.sources.retrieve_async("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", @@ -28181,30 +21366,6 @@ async def test_sources_get_2_service_async( api_base="https://api.stripe.com", ) - def test_sources_post_service_non_namespaced( - 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", - ) - def test_sources_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Source.modify( "src_xxxxxxxxxxxxx", @@ -28229,7 +21390,7 @@ def test_sources_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.sources.update( + client.sources.update( "src_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -28269,7 +21430,7 @@ async def test_sources_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.sources.update_async( + await client.sources.update_async( "src_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -28281,26 +21442,6 @@ async def test_sources_post_service_async( post_data="metadata[order_id]=6735", ) - def test_subscription_items_delete_service_non_namespaced( - 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", - ) - def test_subscription_items_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -28323,7 +21464,7 @@ def test_subscription_items_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_items.delete("si_xxxxxxxxxxxxx") + client.subscription_items.delete("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscription_items/si_xxxxxxxxxxxxx", @@ -28355,7 +21496,7 @@ async def test_subscription_items_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_items.delete_async("si_xxxxxxxxxxxxx") + await client.subscription_items.delete_async("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscription_items/si_xxxxxxxxxxxxx", @@ -28363,27 +21504,6 @@ async def test_subscription_items_delete_service_async( api_base="https://api.stripe.com", ) - def test_subscription_items_get_service_non_namespaced( - 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", - ) - def test_subscription_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -28407,9 +21527,7 @@ def test_subscription_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_items.list( - {"subscription": "sub_xxxxxxxxxxxxx"} - ) + client.subscription_items.list({"subscription": "sub_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "get", path="/v1/subscription_items", @@ -28444,7 +21562,7 @@ async def test_subscription_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_items.list_async( + await client.subscription_items.list_async( { "subscription": "sub_xxxxxxxxxxxxx", } @@ -28456,26 +21574,6 @@ async def test_subscription_items_get_service_async( api_base="https://api.stripe.com", ) - def test_subscription_items_get_2_service_non_namespaced( - 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", - ) - def test_subscription_items_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -28498,7 +21596,7 @@ def test_subscription_items_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_items.retrieve("si_xxxxxxxxxxxxx") + client.subscription_items.retrieve("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx", @@ -28530,7 +21628,7 @@ async def test_subscription_items_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_items.retrieve_async("si_xxxxxxxxxxxxx") + await client.subscription_items.retrieve_async("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx", @@ -28538,33 +21636,6 @@ async def test_subscription_items_get_2_service_async( api_base="https://api.stripe.com", ) - def test_subscription_items_post_service_non_namespaced( - 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", - ) - def test_subscription_items_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28592,7 +21663,7 @@ def test_subscription_items_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_items.create( + client.subscription_items.create( { "subscription": "sub_xxxxxxxxxxxxx", "price": "price_xxxxxxxxxxxxx", @@ -28636,7 +21707,7 @@ async def test_subscription_items_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_items.create_async( + await client.subscription_items.create_async( { "subscription": "sub_xxxxxxxxxxxxx", "price": "price_xxxxxxxxxxxxx", @@ -28651,30 +21722,6 @@ async def test_subscription_items_post_service_async( post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", ) - def test_subscription_items_post_2_service_non_namespaced( - 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", - ) - def test_subscription_items_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -28701,7 +21748,7 @@ def test_subscription_items_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_items.update( + client.subscription_items.update( "si_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -28741,7 +21788,7 @@ async def test_subscription_items_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_items.update_async( + await client.subscription_items.update_async( "si_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -28753,26 +21800,6 @@ async def test_subscription_items_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_subscription_schedules_cancel_post_service_non_namespaced( - 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", - ) - def test_subscription_schedules_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -28795,7 +21822,7 @@ def test_subscription_schedules_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_schedules.cancel("sub_sched_xxxxxxxxxxxxx") + client.subscription_schedules.cancel("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", @@ -28829,7 +21856,7 @@ async def test_subscription_schedules_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_schedules.cancel_async( + await client.subscription_schedules.cancel_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -28839,27 +21866,6 @@ async def test_subscription_schedules_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_subscription_schedules_get_service_non_namespaced( - 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", - ) - def test_subscription_schedules_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -28883,7 +21889,7 @@ def test_subscription_schedules_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_schedules.list({"limit": 3}) + client.subscription_schedules.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules", @@ -28916,7 +21922,7 @@ async def test_subscription_schedules_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_schedules.list_async({"limit": 3}) + await client.subscription_schedules.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules", @@ -28924,26 +21930,6 @@ async def test_subscription_schedules_get_service_async( api_base="https://api.stripe.com", ) - def test_subscription_schedules_get_2_service_non_namespaced( - 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", - ) - def test_subscription_schedules_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -28966,7 +21952,7 @@ def test_subscription_schedules_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_schedules.retrieve("sub_sched_xxxxxxxxxxxxx") + client.subscription_schedules.retrieve("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", @@ -29000,7 +21986,7 @@ async def test_subscription_schedules_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_schedules.retrieve_async( + await client.subscription_schedules.retrieve_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -29010,41 +21996,6 @@ async def test_subscription_schedules_get_2_service_async( api_base="https://api.stripe.com", ) - def test_subscription_schedules_post_service_non_namespaced( - 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", - ) - def test_subscription_schedules_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -29078,7 +22029,7 @@ def test_subscription_schedules_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_schedules.create( + client.subscription_schedules.create( { "customer": "cus_xxxxxxxxxxxxx", "start_date": 1676070661, @@ -29136,7 +22087,7 @@ async def test_subscription_schedules_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_schedules.create_async( + await client.subscription_schedules.create_async( { "customer": "cus_xxxxxxxxxxxxx", "start_date": 1676070661, @@ -29159,30 +22110,6 @@ async def test_subscription_schedules_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_subscription_schedules_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -29209,7 +22136,7 @@ def test_subscription_schedules_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_schedules.update( + client.subscription_schedules.update( "sub_sched_xxxxxxxxxxxxx", {"end_behavior": "release"}, ) @@ -29249,7 +22176,7 @@ async def test_subscription_schedules_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_schedules.update_async( + await client.subscription_schedules.update_async( "sub_sched_xxxxxxxxxxxxx", {"end_behavior": "release"}, ) @@ -29261,26 +22188,6 @@ async def test_subscription_schedules_post_2_service_async( post_data="end_behavior=release", ) - def test_subscription_schedules_release_post_service_non_namespaced( - 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", - ) - def test_subscription_schedules_release_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -29303,7 +22210,7 @@ def test_subscription_schedules_release_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscription_schedules.release("sub_sched_xxxxxxxxxxxxx") + client.subscription_schedules.release("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", @@ -29337,7 +22244,7 @@ async def test_subscription_schedules_release_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscription_schedules.release_async( + await client.subscription_schedules.release_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -29347,26 +22254,6 @@ async def test_subscription_schedules_release_post_service_async( api_base="https://api.stripe.com", ) - def test_subscriptions_delete_service_non_namespaced( - 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", - ) - def test_subscriptions_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -29389,7 +22276,7 @@ def test_subscriptions_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscriptions.cancel("sub_xxxxxxxxxxxxx") + client.subscriptions.cancel("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", @@ -29421,7 +22308,7 @@ async def test_subscriptions_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscriptions.cancel_async("sub_xxxxxxxxxxxxx") + await client.subscriptions.cancel_async("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", @@ -29429,26 +22316,6 @@ async def test_subscriptions_delete_service_async( api_base="https://api.stripe.com", ) - def test_subscriptions_discount_delete_service_non_namespaced( - 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", - ) - def test_subscriptions_discount_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -29471,7 +22338,7 @@ def test_subscriptions_discount_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscriptions.delete_discount("sub_xyz") + client.subscriptions.delete_discount("sub_xyz") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xyz/discount", @@ -29503,7 +22370,7 @@ async def test_subscriptions_discount_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscriptions.delete_discount_async("sub_xyz") + await client.subscriptions.delete_discount_async("sub_xyz") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xyz/discount", @@ -29511,27 +22378,6 @@ async def test_subscriptions_discount_delete_service_async( api_base="https://api.stripe.com", ) - def test_subscriptions_get_service_non_namespaced( - 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", - ) - def test_subscriptions_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Subscription.list(limit=3) http_client_mock.assert_requested( @@ -29553,7 +22399,7 @@ def test_subscriptions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscriptions.list({"limit": 3}) + client.subscriptions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscriptions", @@ -29586,7 +22432,7 @@ async def test_subscriptions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscriptions.list_async({"limit": 3}) + await client.subscriptions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscriptions", @@ -29594,26 +22440,6 @@ async def test_subscriptions_get_service_async( api_base="https://api.stripe.com", ) - def test_subscriptions_get_2_service_non_namespaced( - 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", - ) - def test_subscriptions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -29636,7 +22462,7 @@ def test_subscriptions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscriptions.retrieve("sub_xxxxxxxxxxxxx") + client.subscriptions.retrieve("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", @@ -29668,7 +22494,7 @@ async def test_subscriptions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscriptions.retrieve_async("sub_xxxxxxxxxxxxx") + await client.subscriptions.retrieve_async("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", @@ -29676,7 +22502,21 @@ async def test_subscriptions_get_2_service_async( api_base="https://api.stripe.com", ) - def test_subscriptions_post_service_non_namespaced( + 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( @@ -29702,46 +22542,6 @@ def test_subscriptions_post_service_non_namespaced( post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) - 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.v1.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 @@ -29770,7 +22570,7 @@ async def test_subscriptions_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscriptions.create_async( + await client.subscriptions.create_async( { "customer": "cus_xxxxxxxxxxxxx", "items": [{"price": "price_xxxxxxxxxxxxx"}], @@ -29784,30 +22584,6 @@ async def test_subscriptions_post_service_async( post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) - def test_subscriptions_post_2_service_non_namespaced( - 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", - ) - def test_subscriptions_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -29834,7 +22610,7 @@ def test_subscriptions_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscriptions.update( + client.subscriptions.update( "sub_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -29874,7 +22650,7 @@ async def test_subscriptions_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscriptions.update_async( + await client.subscriptions.update_async( "sub_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -29886,31 +22662,6 @@ async def test_subscriptions_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_subscriptions_search_get_service_non_namespaced( - 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", - ) - def test_subscriptions_search_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -29936,7 +22687,7 @@ def test_subscriptions_search_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.subscriptions.search( + client.subscriptions.search( { "query": "status:'active' AND metadata['order_id']:'6735'", } @@ -29975,7 +22726,7 @@ async def test_subscriptions_search_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.subscriptions.search_async( + await client.subscriptions.search_async( { "query": "status:'active' AND metadata['order_id']:'6735'", } @@ -29987,26 +22738,6 @@ async def test_subscriptions_search_get_service_async( api_base="https://api.stripe.com", ) - def test_tax_calculations_line_items_get_service_non_namespaced( - 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", - ) - def test_tax_calculations_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -30029,7 +22760,7 @@ def test_tax_calculations_line_items_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax.calculations.line_items.list("xxx") + client.tax.calculations.line_items.list("xxx") http_client_mock.assert_requested( "get", path="/v1/tax/calculations/xxx/line_items", @@ -30061,7 +22792,7 @@ async def test_tax_calculations_line_items_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax.calculations.line_items.list_async("xxx") + await client.tax.calculations.line_items.list_async("xxx") http_client_mock.assert_requested( "get", path="/v1/tax/calculations/xxx/line_items", @@ -30069,42 +22800,6 @@ async def test_tax_calculations_line_items_get_service_async( api_base="https://api.stripe.com", ) - def test_tax_calculations_post_service_non_namespaced( - 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", - ) - def test_tax_calculations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -30141,7 +22836,7 @@ def test_tax_calculations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax.calculations.create( + client.tax.calculations.create( { "currency": "usd", "line_items": [{"amount": 1000, "reference": "L1"}], @@ -30203,7 +22898,7 @@ async def test_tax_calculations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax.calculations.create_async( + await client.tax.calculations.create_async( { "currency": "usd", "line_items": [{"amount": 1000, "reference": "L1"}], @@ -30227,27 +22922,6 @@ async def test_tax_calculations_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_tax_codes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxCode.list(limit=3) http_client_mock.assert_requested( @@ -30269,7 +22943,7 @@ def test_tax_codes_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_codes.list({"limit": 3}) + client.tax_codes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_codes", @@ -30302,7 +22976,7 @@ async def test_tax_codes_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_codes.list_async({"limit": 3}) + await client.tax_codes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_codes", @@ -30310,26 +22984,6 @@ async def test_tax_codes_get_service_async( api_base="https://api.stripe.com", ) - def test_tax_codes_get_2_service_non_namespaced( - 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", - ) - def test_tax_codes_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxCode.retrieve("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -30350,7 +23004,7 @@ def test_tax_codes_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_codes.retrieve("txcd_xxxxxxxxxxxxx") + client.tax_codes.retrieve("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", @@ -30382,7 +23036,7 @@ async def test_tax_codes_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_codes.retrieve_async("txcd_xxxxxxxxxxxxx") + await client.tax_codes.retrieve_async("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", @@ -30390,26 +23044,6 @@ async def test_tax_codes_get_2_service_async( api_base="https://api.stripe.com", ) - def test_tax_ids_delete_service_non_namespaced( - 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", - ) - def test_tax_ids_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.delete("taxid_123") http_client_mock.assert_requested( @@ -30430,7 +23064,7 @@ def test_tax_ids_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_ids.delete("taxid_123") + client.tax_ids.delete("taxid_123") http_client_mock.assert_requested( "delete", path="/v1/tax_ids/taxid_123", @@ -30462,7 +23096,7 @@ async def test_tax_ids_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_ids.delete_async("taxid_123") + await client.tax_ids.delete_async("taxid_123") http_client_mock.assert_requested( "delete", path="/v1/tax_ids/taxid_123", @@ -30470,26 +23104,6 @@ async def test_tax_ids_delete_service_async( api_base="https://api.stripe.com", ) - def test_tax_ids_get_service_non_namespaced( - 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", - ) - def test_tax_ids_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.list() http_client_mock.assert_requested( @@ -30510,7 +23124,7 @@ def test_tax_ids_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_ids.list() + client.tax_ids.list() http_client_mock.assert_requested( "get", path="/v1/tax_ids", @@ -30542,7 +23156,7 @@ async def test_tax_ids_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_ids.list_async() + await client.tax_ids.list_async() http_client_mock.assert_requested( "get", path="/v1/tax_ids", @@ -30550,26 +23164,6 @@ async def test_tax_ids_get_service_async( api_base="https://api.stripe.com", ) - def test_tax_ids_get_2_service_non_namespaced( - 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", - ) - def test_tax_ids_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.retrieve("taxid_123") http_client_mock.assert_requested( @@ -30590,7 +23184,7 @@ def test_tax_ids_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_ids.retrieve("taxid_123") + client.tax_ids.retrieve("taxid_123") http_client_mock.assert_requested( "get", path="/v1/tax_ids/taxid_123", @@ -30622,7 +23216,7 @@ async def test_tax_ids_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_ids.retrieve_async("taxid_123") + await client.tax_ids.retrieve_async("taxid_123") http_client_mock.assert_requested( "get", path="/v1/tax_ids/taxid_123", @@ -30630,27 +23224,6 @@ async def test_tax_ids_get_2_service_async( api_base="https://api.stripe.com", ) - def test_tax_ids_post_service_non_namespaced( - 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", - ) - def test_tax_ids_post(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.create( type="eu_vat", @@ -30675,7 +23248,7 @@ def test_tax_ids_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_ids.create({"type": "eu_vat", "value": "123"}) + client.tax_ids.create({"type": "eu_vat", "value": "123"}) http_client_mock.assert_requested( "post", path="/v1/tax_ids", @@ -30712,9 +23285,7 @@ async def test_tax_ids_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_ids.create_async( - {"type": "eu_vat", "value": "123"} - ) + await client.tax_ids.create_async({"type": "eu_vat", "value": "123"}) http_client_mock.assert_requested( "post", path="/v1/tax_ids", @@ -30723,27 +23294,6 @@ async def test_tax_ids_post_service_async( post_data="type=eu_vat&value=123", ) - def test_tax_rates_get_service_non_namespaced( - 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", - ) - def test_tax_rates_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.list(limit=3) http_client_mock.assert_requested( @@ -30765,7 +23315,7 @@ def test_tax_rates_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_rates.list({"limit": 3}) + client.tax_rates.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_rates", @@ -30798,7 +23348,7 @@ async def test_tax_rates_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_rates.list_async({"limit": 3}) + await client.tax_rates.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_rates", @@ -30806,26 +23356,6 @@ async def test_tax_rates_get_service_async( api_base="https://api.stripe.com", ) - def test_tax_rates_get_2_service_non_namespaced( - 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", - ) - def test_tax_rates_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.retrieve("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -30846,7 +23376,7 @@ def test_tax_rates_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_rates.retrieve("txr_xxxxxxxxxxxxx") + client.tax_rates.retrieve("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", @@ -30878,7 +23408,7 @@ async def test_tax_rates_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_rates.retrieve_async("txr_xxxxxxxxxxxxx") + await client.tax_rates.retrieve_async("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", @@ -30886,35 +23416,6 @@ async def test_tax_rates_get_2_service_async( api_base="https://api.stripe.com", ) - def test_tax_rates_post_service_non_namespaced( - 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", - ) - def test_tax_rates_post(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.create( display_name="VAT", @@ -30942,7 +23443,7 @@ def test_tax_rates_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_rates.create( + client.tax_rates.create( { "display_name": "VAT", "description": "VAT Germany", @@ -30990,7 +23491,7 @@ async def test_tax_rates_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_rates.create_async( + await client.tax_rates.create_async( { "display_name": "VAT", "description": "VAT Germany", @@ -31007,30 +23508,6 @@ async def test_tax_rates_post_service_async( post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=false", ) - def test_tax_rates_post_2_service_non_namespaced( - 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", - ) - def test_tax_rates_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.modify( "txr_xxxxxxxxxxxxx", @@ -31055,7 +23532,7 @@ def test_tax_rates_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax_rates.update( + client.tax_rates.update( "txr_xxxxxxxxxxxxx", {"active": False}, ) @@ -31095,7 +23572,7 @@ async def test_tax_rates_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax_rates.update_async( + await client.tax_rates.update_async( "txr_xxxxxxxxxxxxx", {"active": False}, ) @@ -31107,27 +23584,6 @@ async def test_tax_rates_post_2_service_async( post_data="active=false", ) - def test_tax_registrations_get_service_non_namespaced( - 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", - ) - def test_tax_registrations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -31151,7 +23607,7 @@ def test_tax_registrations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax.registrations.list({"status": "all"}) + client.tax.registrations.list({"status": "all"}) http_client_mock.assert_requested( "get", path="/v1/tax/registrations", @@ -31184,7 +23640,7 @@ async def test_tax_registrations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax.registrations.list_async({"status": "all"}) + await client.tax.registrations.list_async({"status": "all"}) http_client_mock.assert_requested( "get", path="/v1/tax/registrations", @@ -31192,33 +23648,6 @@ async def test_tax_registrations_get_service_async( api_base="https://api.stripe.com", ) - def test_tax_registrations_post_service_non_namespaced( - 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", - ) - def test_tax_registrations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -31246,7 +23675,7 @@ def test_tax_registrations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax.registrations.create( + client.tax.registrations.create( { "country": "IE", "country_options": {"ie": {"type": "oss_union"}}, @@ -31290,7 +23719,7 @@ async def test_tax_registrations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax.registrations.create_async( + await client.tax.registrations.create_async( { "country": "IE", "country_options": {"ie": {"type": "oss_union"}}, @@ -31305,30 +23734,6 @@ async def test_tax_registrations_post_service_async( post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", ) - def test_tax_registrations_post_2_service_non_namespaced( - 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", - ) - def test_tax_registrations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -31355,7 +23760,7 @@ def test_tax_registrations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax.registrations.update( + client.tax.registrations.update( "taxreg_xxxxxxxxxxxxx", {"expires_at": "now"}, ) @@ -31395,7 +23800,7 @@ async def test_tax_registrations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax.registrations.update_async( + await client.tax.registrations.update_async( "taxreg_xxxxxxxxxxxxx", {"expires_at": "now"}, ) @@ -31407,26 +23812,6 @@ async def test_tax_registrations_post_2_service_async( post_data="expires_at=now", ) - def test_tax_settings_get_service_non_namespaced( - 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", - ) - def test_tax_settings_get(self, http_client_mock: HTTPClientMock) -> None: stripe.tax.Settings.retrieve() http_client_mock.assert_requested( @@ -31447,7 +23832,7 @@ def test_tax_settings_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax.settings.retrieve() + client.tax.settings.retrieve() http_client_mock.assert_requested( "get", path="/v1/tax/settings", @@ -31479,7 +23864,7 @@ async def test_tax_settings_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax.settings.retrieve_async() + await client.tax.settings.retrieve_async() http_client_mock.assert_requested( "get", path="/v1/tax/settings", @@ -31487,27 +23872,6 @@ async def test_tax_settings_get_service_async( api_base="https://api.stripe.com", ) - def test_tax_settings_post_service_non_namespaced( - 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", - ) - 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( @@ -31529,11 +23893,7 @@ def test_tax_settings_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax.settings.update( - { - "defaults": {"tax_code": "txcd_10000000"}, - } - ) + client.tax.settings.update({"defaults": {"tax_code": "txcd_10000000"}}) http_client_mock.assert_requested( "post", path="/v1/tax/settings", @@ -31569,7 +23929,7 @@ async def test_tax_settings_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax.settings.update_async( + await client.tax.settings.update_async( { "defaults": {"tax_code": "txcd_10000000"}, } @@ -31582,32 +23942,6 @@ async def test_tax_settings_post_service_async( post_data="defaults[tax_code]=txcd_10000000", ) - def test_tax_transactions_create_from_calculation_post_service_non_namespaced( - 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", - ) - def test_tax_transactions_create_from_calculation_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -31634,7 +23968,7 @@ def test_tax_transactions_create_from_calculation_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tax.transactions.create_from_calculation( + client.tax.transactions.create_from_calculation( { "calculation": "xxx", "reference": "yyy", @@ -31676,7 +24010,7 @@ async def test_tax_transactions_create_from_calculation_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tax.transactions.create_from_calculation_async( + await client.tax.transactions.create_from_calculation_async( { "calculation": "xxx", "reference": "yyy", @@ -31690,26 +24024,6 @@ async def test_tax_transactions_create_from_calculation_post_service_async( post_data="calculation=xxx&reference=yyy", ) - def test_terminal_configurations_delete_service_non_namespaced( - 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", - ) - def test_terminal_configurations_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -31732,7 +24046,7 @@ def test_terminal_configurations_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.delete("uc_123") + client.terminal.configurations.delete("uc_123") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/uc_123", @@ -31764,7 +24078,7 @@ async def test_terminal_configurations_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.delete_async("uc_123") + await client.terminal.configurations.delete_async("uc_123") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/uc_123", @@ -31772,26 +24086,6 @@ async def test_terminal_configurations_delete_service_async( api_base="https://api.stripe.com", ) - def test_terminal_configurations_delete_2_service_non_namespaced( - 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", - ) - def test_terminal_configurations_delete_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -31814,7 +24108,7 @@ def test_terminal_configurations_delete_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.delete("tmc_xxxxxxxxxxxxx") + client.terminal.configurations.delete("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", @@ -31846,9 +24140,7 @@ async def test_terminal_configurations_delete_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.delete_async( - "tmc_xxxxxxxxxxxxx", - ) + await client.terminal.configurations.delete_async("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", @@ -31856,26 +24148,6 @@ async def test_terminal_configurations_delete_2_service_async( api_base="https://api.stripe.com", ) - def test_terminal_configurations_get_service_non_namespaced( - 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", - ) - def test_terminal_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -31898,7 +24170,7 @@ def test_terminal_configurations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.list() + client.terminal.configurations.list() http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", @@ -31930,7 +24202,7 @@ async def test_terminal_configurations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.list_async() + await client.terminal.configurations.list_async() http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", @@ -31938,26 +24210,6 @@ async def test_terminal_configurations_get_service_async( api_base="https://api.stripe.com", ) - def test_terminal_configurations_get_2_service_non_namespaced( - 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", - ) - def test_terminal_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -31980,7 +24232,7 @@ def test_terminal_configurations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.retrieve("uc_123") + client.terminal.configurations.retrieve("uc_123") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/uc_123", @@ -32012,7 +24264,7 @@ async def test_terminal_configurations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.retrieve_async("uc_123") + await client.terminal.configurations.retrieve_async("uc_123") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/uc_123", @@ -32020,27 +24272,6 @@ async def test_terminal_configurations_get_2_service_async( api_base="https://api.stripe.com", ) - def test_terminal_configurations_get_3_service_non_namespaced( - 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", - ) - def test_terminal_configurations_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -32064,7 +24295,7 @@ def test_terminal_configurations_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.list({"limit": 3}) + client.terminal.configurations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", @@ -32097,7 +24328,7 @@ async def test_terminal_configurations_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.list_async({"limit": 3}) + await client.terminal.configurations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", @@ -32105,26 +24336,6 @@ async def test_terminal_configurations_get_3_service_async( api_base="https://api.stripe.com", ) - def test_terminal_configurations_get_4_service_non_namespaced( - 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", - ) - def test_terminal_configurations_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -32147,7 +24358,7 @@ def test_terminal_configurations_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.retrieve("tmc_xxxxxxxxxxxxx") + client.terminal.configurations.retrieve("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", @@ -32179,8 +24390,8 @@ async def test_terminal_configurations_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.retrieve_async( - "tmc_xxxxxxxxxxxxx", + await client.terminal.configurations.retrieve_async( + "tmc_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", @@ -32189,26 +24400,6 @@ async def test_terminal_configurations_get_4_service_async( api_base="https://api.stripe.com", ) - def test_terminal_configurations_post_service_non_namespaced( - 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", - ) - def test_terminal_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -32231,7 +24422,7 @@ def test_terminal_configurations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.create() + client.terminal.configurations.create() http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", @@ -32263,7 +24454,7 @@ async def test_terminal_configurations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.create_async() + await client.terminal.configurations.create_async() http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", @@ -32271,30 +24462,6 @@ async def test_terminal_configurations_post_service_async( api_base="https://api.stripe.com", ) - def test_terminal_configurations_post_2_service_non_namespaced( - 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", - ) - def test_terminal_configurations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -32321,7 +24488,7 @@ def test_terminal_configurations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.update( + client.terminal.configurations.update( "uc_123", {"tipping": {"usd": {"fixed_amounts": [10]}}}, ) @@ -32361,7 +24528,7 @@ async def test_terminal_configurations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.update_async( + await client.terminal.configurations.update_async( "uc_123", {"tipping": {"usd": {"fixed_amounts": [10]}}}, ) @@ -32373,31 +24540,6 @@ async def test_terminal_configurations_post_2_service_async( post_data="tipping[usd][fixed_amounts][0]=10", ) - def test_terminal_configurations_post_3_service_non_namespaced( - 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", - ) - def test_terminal_configurations_post_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -32423,7 +24565,7 @@ def test_terminal_configurations_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.create( + client.terminal.configurations.create( { "bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}, } @@ -32463,7 +24605,7 @@ async def test_terminal_configurations_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.create_async( + await client.terminal.configurations.create_async( { "bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}, } @@ -32476,30 +24618,6 @@ async def test_terminal_configurations_post_3_service_async( post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) - def test_terminal_configurations_post_4_service_non_namespaced( - 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", - ) - def test_terminal_configurations_post_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -32526,7 +24644,7 @@ def test_terminal_configurations_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.configurations.update( + client.terminal.configurations.update( "tmc_xxxxxxxxxxxxx", {"bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}}, ) @@ -32566,7 +24684,7 @@ async def test_terminal_configurations_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.configurations.update_async( + await client.terminal.configurations.update_async( "tmc_xxxxxxxxxxxxx", {"bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}}, ) @@ -32578,26 +24696,6 @@ async def test_terminal_configurations_post_4_service_async( post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) - def test_terminal_connection_tokens_post_service_non_namespaced( - 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", - ) - def test_terminal_connection_tokens_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -32620,7 +24718,7 @@ def test_terminal_connection_tokens_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.connection_tokens.create() + client.terminal.connection_tokens.create() http_client_mock.assert_requested( "post", path="/v1/terminal/connection_tokens", @@ -32652,7 +24750,7 @@ async def test_terminal_connection_tokens_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.connection_tokens.create_async() + await client.terminal.connection_tokens.create_async() http_client_mock.assert_requested( "post", path="/v1/terminal/connection_tokens", @@ -32660,26 +24758,6 @@ async def test_terminal_connection_tokens_post_service_async( api_base="https://api.stripe.com", ) - def test_terminal_locations_delete_service_non_namespaced( - 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", - ) - def test_terminal_locations_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -32702,7 +24780,7 @@ def test_terminal_locations_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.locations.delete("tml_xxxxxxxxxxxxx") + client.terminal.locations.delete("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", @@ -32734,7 +24812,7 @@ async def test_terminal_locations_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.locations.delete_async("tml_xxxxxxxxxxxxx") + await client.terminal.locations.delete_async("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", @@ -32742,27 +24820,6 @@ async def test_terminal_locations_delete_service_async( api_base="https://api.stripe.com", ) - def test_terminal_locations_get_service_non_namespaced( - 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", - ) - def test_terminal_locations_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -32786,7 +24843,7 @@ def test_terminal_locations_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.locations.list({"limit": 3}) + client.terminal.locations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/locations", @@ -32819,7 +24876,7 @@ async def test_terminal_locations_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.locations.list_async({"limit": 3}) + await client.terminal.locations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/locations", @@ -32827,26 +24884,6 @@ async def test_terminal_locations_get_service_async( api_base="https://api.stripe.com", ) - def test_terminal_locations_get_2_service_non_namespaced( - 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", - ) - def test_terminal_locations_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -32869,7 +24906,7 @@ def test_terminal_locations_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.locations.retrieve("tml_xxxxxxxxxxxxx") + client.terminal.locations.retrieve("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", @@ -32901,7 +24938,7 @@ async def test_terminal_locations_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.locations.retrieve_async("tml_xxxxxxxxxxxxx") + await client.terminal.locations.retrieve_async("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", @@ -32909,38 +24946,6 @@ async def test_terminal_locations_get_2_service_async( api_base="https://api.stripe.com", ) - def test_terminal_locations_post_service_non_namespaced( - 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", - ) - def test_terminal_locations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -32973,7 +24978,7 @@ def test_terminal_locations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.locations.create( + client.terminal.locations.create( { "display_name": "My First Store", "address": { @@ -33027,7 +25032,7 @@ async def test_terminal_locations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.locations.create_async( + await client.terminal.locations.create_async( { "display_name": "My First Store", "address": { @@ -33047,30 +25052,6 @@ async def test_terminal_locations_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_terminal_locations_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -33097,7 +25078,7 @@ def test_terminal_locations_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.locations.update( + client.terminal.locations.update( "tml_xxxxxxxxxxxxx", {"display_name": "My First Store"}, ) @@ -33137,7 +25118,7 @@ async def test_terminal_locations_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.locations.update_async( + await client.terminal.locations.update_async( "tml_xxxxxxxxxxxxx", {"display_name": "My First Store"}, ) @@ -33149,26 +25130,6 @@ async def test_terminal_locations_post_2_service_async( post_data="display_name=My%20First%20Store", ) - def test_terminal_readers_cancel_action_post_service_non_namespaced( - 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", - ) - def test_terminal_readers_cancel_action_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -33191,7 +25152,7 @@ def test_terminal_readers_cancel_action_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.readers.cancel_action("tmr_xxxxxxxxxxxxx") + client.terminal.readers.cancel_action("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", @@ -33223,9 +25184,7 @@ async def test_terminal_readers_cancel_action_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.readers.cancel_action_async( - "tmr_xxxxxxxxxxxxx", - ) + await client.terminal.readers.cancel_action_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", @@ -33233,26 +25192,6 @@ async def test_terminal_readers_cancel_action_post_service_async( api_base="https://api.stripe.com", ) - def test_terminal_readers_delete_service_non_namespaced( - 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", - ) - def test_terminal_readers_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -33275,7 +25214,7 @@ def test_terminal_readers_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.readers.delete("tmr_xxxxxxxxxxxxx") + client.terminal.readers.delete("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", @@ -33307,7 +25246,7 @@ async def test_terminal_readers_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.readers.delete_async("tmr_xxxxxxxxxxxxx") + await client.terminal.readers.delete_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", @@ -33315,27 +25254,6 @@ async def test_terminal_readers_delete_service_async( api_base="https://api.stripe.com", ) - def test_terminal_readers_get_service_non_namespaced( - 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", - ) - def test_terminal_readers_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -33359,7 +25277,7 @@ def test_terminal_readers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.readers.list({"limit": 3}) + client.terminal.readers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/readers", @@ -33392,7 +25310,7 @@ async def test_terminal_readers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.readers.list_async({"limit": 3}) + await client.terminal.readers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/readers", @@ -33400,26 +25318,6 @@ async def test_terminal_readers_get_service_async( api_base="https://api.stripe.com", ) - def test_terminal_readers_get_2_service_non_namespaced( - 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", - ) - def test_terminal_readers_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -33442,7 +25340,7 @@ def test_terminal_readers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.readers.retrieve("tmr_xxxxxxxxxxxxx") + client.terminal.readers.retrieve("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", @@ -33474,7 +25372,7 @@ async def test_terminal_readers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.readers.retrieve_async("tmr_xxxxxxxxxxxxx") + await client.terminal.readers.retrieve_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", @@ -33482,33 +25380,6 @@ async def test_terminal_readers_get_2_service_async( api_base="https://api.stripe.com", ) - def test_terminal_readers_post_service_non_namespaced( - 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", - ) - def test_terminal_readers_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -33536,7 +25407,7 @@ def test_terminal_readers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.readers.create( + client.terminal.readers.create( { "registration_code": "puppies-plug-could", "label": "Blue Rabbit", @@ -33580,7 +25451,7 @@ async def test_terminal_readers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.readers.create_async( + await client.terminal.readers.create_async( { "registration_code": "puppies-plug-could", "label": "Blue Rabbit", @@ -33595,30 +25466,6 @@ async def test_terminal_readers_post_service_async( post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) - def test_terminal_readers_post_2_service_non_namespaced( - 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", - ) - def test_terminal_readers_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -33645,7 +25492,7 @@ def test_terminal_readers_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.readers.update( + client.terminal.readers.update( "tmr_xxxxxxxxxxxxx", {"label": "Blue Rabbit"}, ) @@ -33685,7 +25532,7 @@ async def test_terminal_readers_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.readers.update_async( + await client.terminal.readers.update_async( "tmr_xxxxxxxxxxxxx", {"label": "Blue Rabbit"}, ) @@ -33697,30 +25544,6 @@ async def test_terminal_readers_post_2_service_async( post_data="label=Blue%20Rabbit", ) - def test_terminal_readers_process_payment_intent_post_service_non_namespaced( - 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", - ) - def test_terminal_readers_process_payment_intent_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -33747,7 +25570,7 @@ def test_terminal_readers_process_payment_intent_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.readers.process_payment_intent( + client.terminal.readers.process_payment_intent( "tmr_xxxxxxxxxxxxx", {"payment_intent": "pi_xxxxxxxxxxxxx"}, ) @@ -33787,7 +25610,7 @@ async def test_terminal_readers_process_payment_intent_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.terminal.readers.process_payment_intent_async( + await client.terminal.readers.process_payment_intent_async( "tmr_xxxxxxxxxxxxx", {"payment_intent": "pi_xxxxxxxxxxxxx"}, ) @@ -33799,7 +25622,22 @@ async def test_terminal_readers_process_payment_intent_post_service_async( post_data="payment_intent=pi_xxxxxxxxxxxxx", ) - def test_terminal_readers_process_setup_intent_post_service_non_namespaced( + 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", + allow_redisplay="always", + ) + http_client_mock.assert_requested( + "post", + path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", + query_string="", + post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", + ) + + def test_terminal_readers_process_setup_intent_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -33826,10 +25664,11 @@ def test_terminal_readers_process_setup_intent_post_service_non_namespaced( post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", ) - def test_terminal_readers_process_setup_intent_post( + @pytest.mark.anyio + async def test_terminal_readers_process_setup_intent_post_async( self, http_client_mock: HTTPClientMock ) -> None: - stripe.terminal.Reader.process_setup_intent( + await stripe.terminal.Reader.process_setup_intent_async( "tmr_xxxxxxxxxxxxx", setup_intent="seti_xxxxxxxxxxxxx", allow_redisplay="always", @@ -33841,7 +25680,8 @@ def test_terminal_readers_process_setup_intent_post( post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", ) - def test_terminal_readers_process_setup_intent_post_service( + @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( @@ -33853,7 +25693,7 @@ def test_terminal_readers_process_setup_intent_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.terminal.readers.process_setup_intent( + await client.terminal.readers.process_setup_intent_async( "tmr_xxxxxxxxxxxxx", { "setup_intent": "seti_xxxxxxxxxxxxx", @@ -33868,74 +25708,6 @@ def test_terminal_readers_process_setup_intent_post_service( post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", ) - @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", - allow_redisplay="always", - ) - http_client_mock.assert_requested( - "post", - path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", - query_string="", - post_data="setup_intent=seti_xxxxxxxxxxxxx&allow_redisplay=always", - ) - - @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.v1.terminal.readers.process_setup_intent_async( - "tmr_xxxxxxxxxxxxx", - { - "setup_intent": "seti_xxxxxxxxxxxxx", - "allow_redisplay": "always", - }, - ) - 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&allow_redisplay=always", - ) - - def test_test_helpers_customers_fund_cash_balance_post_service_non_namespaced( - 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", - ) - def test_test_helpers_customers_fund_cash_balance_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -33963,7 +25735,7 @@ def test_test_helpers_customers_fund_cash_balance_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.customers.fund_cash_balance( + client.test_helpers.customers.fund_cash_balance( "cus_123", {"amount": 30, "currency": "eur"}, ) @@ -34004,7 +25776,7 @@ async def test_test_helpers_customers_fund_cash_balance_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.customers.fund_cash_balance_async( + await client.test_helpers.customers.fund_cash_balance_async( "cus_123", {"amount": 30, "currency": "eur"}, ) @@ -34016,67 +25788,6 @@ async def test_test_helpers_customers_fund_cash_balance_post_service_async( post_data="amount=30¤cy=eur", ) - def test_test_helpers_issuing_authorizations_capture_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_authorizations_capture_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -34138,7 +25849,7 @@ def test_test_helpers_issuing_authorizations_capture_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.authorizations.capture( + client.test_helpers.issuing.authorizations.capture( "example_authorization", { "capture_amount": 100, @@ -34250,7 +25961,7 @@ async def test_test_helpers_issuing_authorizations_capture_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.authorizations.capture_async( + await client.test_helpers.issuing.authorizations.capture_async( "example_authorization", { "capture_amount": 100, @@ -34299,28 +26010,6 @@ async def test_test_helpers_issuing_authorizations_capture_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_authorizations_expire_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -34345,7 +26034,7 @@ def test_test_helpers_issuing_authorizations_expire_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.authorizations.expire( + client.test_helpers.issuing.authorizations.expire( "example_authorization", ) http_client_mock.assert_requested( @@ -34381,7 +26070,7 @@ async def test_test_helpers_issuing_authorizations_expire_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.authorizations.expire_async( + await client.test_helpers.issuing.authorizations.expire_async( "example_authorization", ) http_client_mock.assert_requested( @@ -34391,30 +26080,6 @@ async def test_test_helpers_issuing_authorizations_expire_post_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_authorizations_increment_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_authorizations_increment_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -34442,7 +26107,7 @@ def test_test_helpers_issuing_authorizations_increment_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.authorizations.increment( + client.test_helpers.issuing.authorizations.increment( "example_authorization", {"increment_amount": 50, "is_amount_controllable": True}, ) @@ -34483,7 +26148,7 @@ async def test_test_helpers_issuing_authorizations_increment_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.authorizations.increment_async( + await client.test_helpers.issuing.authorizations.increment_async( "example_authorization", {"increment_amount": 50, "is_amount_controllable": True}, ) @@ -34495,54 +26160,6 @@ async def test_test_helpers_issuing_authorizations_increment_post_service_async( post_data="increment_amount=50&is_amount_controllable=true", ) - def test_test_helpers_issuing_authorizations_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_authorizations_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -34591,7 +26208,7 @@ def test_test_helpers_issuing_authorizations_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.authorizations.create( + client.test_helpers.issuing.authorizations.create( { "amount": 100, "amount_details": {"atm_fee": 10, "cashback_amount": 5}, @@ -34677,7 +26294,7 @@ async def test_test_helpers_issuing_authorizations_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.authorizations.create_async( + await client.test_helpers.issuing.authorizations.create_async( { "amount": 100, "amount_details": {"atm_fee": 10, "cashback_amount": 5}, @@ -34713,30 +26330,6 @@ async def test_test_helpers_issuing_authorizations_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_authorizations_reverse_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -34763,7 +26356,7 @@ def test_test_helpers_issuing_authorizations_reverse_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.authorizations.reverse( + client.test_helpers.issuing.authorizations.reverse( "example_authorization", {"reverse_amount": 20}, ) @@ -34803,7 +26396,7 @@ async def test_test_helpers_issuing_authorizations_reverse_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.authorizations.reverse_async( + await client.test_helpers.issuing.authorizations.reverse_async( "example_authorization", {"reverse_amount": 20}, ) @@ -34815,26 +26408,6 @@ async def test_test_helpers_issuing_authorizations_reverse_post_service_async( post_data="reverse_amount=20", ) - def test_test_helpers_issuing_cards_shipping_deliver_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_cards_shipping_deliver_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -34857,7 +26430,7 @@ def test_test_helpers_issuing_cards_shipping_deliver_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.cards.deliver_card("card_123") + 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", @@ -34889,9 +26462,7 @@ async def test_test_helpers_issuing_cards_shipping_deliver_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.cards.deliver_card_async( - "card_123", - ) + 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", @@ -34899,26 +26470,6 @@ async def test_test_helpers_issuing_cards_shipping_deliver_post_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_cards_shipping_fail_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_cards_shipping_fail_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -34941,7 +26492,7 @@ def test_test_helpers_issuing_cards_shipping_fail_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.cards.fail_card("card_123") + 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", @@ -34973,7 +26524,7 @@ async def test_test_helpers_issuing_cards_shipping_fail_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.cards.fail_card_async("card_123") + 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", @@ -34981,26 +26532,6 @@ async def test_test_helpers_issuing_cards_shipping_fail_post_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_cards_shipping_return_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_cards_shipping_return_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -35023,7 +26554,7 @@ def test_test_helpers_issuing_cards_shipping_return_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.cards.return_card("card_123") + 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", @@ -35055,9 +26586,7 @@ async def test_test_helpers_issuing_cards_shipping_return_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.cards.return_card_async( - "card_123" - ) + 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", @@ -35065,26 +26594,6 @@ async def test_test_helpers_issuing_cards_shipping_return_post_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_cards_shipping_ship_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_cards_shipping_ship_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -35107,7 +26616,7 @@ def test_test_helpers_issuing_cards_shipping_ship_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.cards.ship_card("card_123") + 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", @@ -35139,7 +26648,7 @@ async def test_test_helpers_issuing_cards_shipping_ship_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.cards.ship_card_async("card_123") + 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", @@ -35147,26 +26656,6 @@ async def test_test_helpers_issuing_cards_shipping_ship_post_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_personalization_designs_activate_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_personalization_designs_activate_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -35189,9 +26678,7 @@ def test_test_helpers_issuing_personalization_designs_activate_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.personalization_designs.activate( - "pd_xyz", - ) + 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", @@ -35225,8 +26712,10 @@ async def test_test_helpers_issuing_personalization_designs_activate_post_servic http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.personalization_designs.activate_async( - "pd_xyz" + await ( + client.test_helpers.issuing.personalization_designs.activate_async( + "pd_xyz" + ) ) http_client_mock.assert_requested( "post", @@ -35235,28 +26724,6 @@ async def test_test_helpers_issuing_personalization_designs_activate_post_servic api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_personalization_designs_deactivate_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_personalization_designs_deactivate_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -35279,8 +26746,8 @@ def test_test_helpers_issuing_personalization_designs_deactivate_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.personalization_designs.deactivate( - "pd_xyz", + client.test_helpers.issuing.personalization_designs.deactivate( + "pd_xyz" ) http_client_mock.assert_requested( "post", @@ -35317,7 +26784,7 @@ async def test_test_helpers_issuing_personalization_designs_deactivate_post_serv http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.personalization_designs.deactivate_async( + await client.test_helpers.issuing.personalization_designs.deactivate_async( "pd_xyz" ) http_client_mock.assert_requested( @@ -35327,30 +26794,6 @@ async def test_test_helpers_issuing_personalization_designs_deactivate_post_serv api_base="https://api.stripe.com", ) - def test_test_helpers_issuing_personalization_designs_reject_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_personalization_designs_reject_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -35377,7 +26820,7 @@ def test_test_helpers_issuing_personalization_designs_reject_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.personalization_designs.reject( + client.test_helpers.issuing.personalization_designs.reject( "pd_xyz", {"rejection_reasons": {"card_logo": ["geographic_location"]}}, ) @@ -35417,7 +26860,7 @@ async def test_test_helpers_issuing_personalization_designs_reject_post_service_ http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.personalization_designs.reject_async( + await client.test_helpers.issuing.personalization_designs.reject_async( "pd_xyz", {"rejection_reasons": {"card_logo": ["geographic_location"]}}, ) @@ -35429,77 +26872,6 @@ async def test_test_helpers_issuing_personalization_designs_reject_post_service_ post_data="rejection_reasons[card_logo][0]=geographic_location", ) - def test_test_helpers_issuing_transactions_create_force_capture_post_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_transactions_create_force_capture_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -35571,7 +26943,7 @@ def test_test_helpers_issuing_transactions_create_force_capture_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.transactions.create_force_capture( + client.test_helpers.issuing.transactions.create_force_capture( { "amount": 100, "card": "foo", @@ -35705,7 +27077,7 @@ async def test_test_helpers_issuing_transactions_create_force_capture_post_servi http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.transactions.create_force_capture_async( + await client.test_helpers.issuing.transactions.create_force_capture_async( { "amount": 100, "card": "foo", @@ -35764,7 +27136,66 @@ async def test_test_helpers_issuing_transactions_create_force_capture_post_servi 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_service_non_namespaced( + 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( @@ -35835,136 +27266,6 @@ def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service_n 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( - 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.v1.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 @@ -36038,7 +27339,7 @@ async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_ser http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.transactions.create_unlinked_refund_async( + await client.test_helpers.issuing.transactions.create_unlinked_refund_async( { "amount": 100, "card": "foo", @@ -36097,30 +27398,6 @@ async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_ser 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_service_non_namespaced( - 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", - ) - def test_test_helpers_issuing_transactions_refund_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -36147,7 +27424,7 @@ def test_test_helpers_issuing_transactions_refund_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.issuing.transactions.refund( + client.test_helpers.issuing.transactions.refund( "example_transaction", {"refund_amount": 50}, ) @@ -36187,7 +27464,7 @@ async def test_test_helpers_issuing_transactions_refund_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.issuing.transactions.refund_async( + await client.test_helpers.issuing.transactions.refund_async( "example_transaction", {"refund_amount": 50}, ) @@ -36199,26 +27476,6 @@ async def test_test_helpers_issuing_transactions_refund_post_service_async( post_data="refund_amount=50", ) - def test_test_helpers_refunds_expire_post_service_non_namespaced( - 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", - ) - def test_test_helpers_refunds_expire_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -36241,7 +27498,7 @@ def test_test_helpers_refunds_expire_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.refunds.expire("re_123") + client.test_helpers.refunds.expire("re_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/refunds/re_123/expire", @@ -36273,7 +27530,7 @@ async def test_test_helpers_refunds_expire_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.refunds.expire_async("re_123") + await client.test_helpers.refunds.expire_async("re_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/refunds/re_123/expire", @@ -36281,30 +27538,6 @@ async def test_test_helpers_refunds_expire_post_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_advance_post_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_advance_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -36331,7 +27564,7 @@ def test_test_helpers_test_clocks_advance_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.advance( + client.test_helpers.test_clocks.advance( "clock_xyz", {"frozen_time": 142}, ) @@ -36371,7 +27604,7 @@ async def test_test_helpers_test_clocks_advance_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.advance_async( + await client.test_helpers.test_clocks.advance_async( "clock_xyz", {"frozen_time": 142}, ) @@ -36383,30 +27616,6 @@ async def test_test_helpers_test_clocks_advance_post_service_async( post_data="frozen_time=142", ) - def test_test_helpers_test_clocks_advance_post_2_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_advance_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -36433,7 +27642,7 @@ def test_test_helpers_test_clocks_advance_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.advance( + client.test_helpers.test_clocks.advance( "clock_xxxxxxxxxxxxx", {"frozen_time": 1675552261}, ) @@ -36473,7 +27682,7 @@ async def test_test_helpers_test_clocks_advance_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.advance_async( + await client.test_helpers.test_clocks.advance_async( "clock_xxxxxxxxxxxxx", {"frozen_time": 1675552261}, ) @@ -36485,26 +27694,6 @@ async def test_test_helpers_test_clocks_advance_post_2_service_async( post_data="frozen_time=1675552261", ) - def test_test_helpers_test_clocks_delete_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -36527,7 +27716,7 @@ def test_test_helpers_test_clocks_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.delete("clock_xyz") + client.test_helpers.test_clocks.delete("clock_xyz") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xyz", @@ -36559,7 +27748,7 @@ async def test_test_helpers_test_clocks_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.delete_async("clock_xyz") + await client.test_helpers.test_clocks.delete_async("clock_xyz") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xyz", @@ -36567,26 +27756,6 @@ async def test_test_helpers_test_clocks_delete_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_delete_2_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_delete_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -36609,7 +27778,7 @@ def test_test_helpers_test_clocks_delete_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.delete("clock_xxxxxxxxxxxxx") + client.test_helpers.test_clocks.delete("clock_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", @@ -36641,7 +27810,7 @@ async def test_test_helpers_test_clocks_delete_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.delete_async( + await client.test_helpers.test_clocks.delete_async( "clock_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -36651,26 +27820,6 @@ async def test_test_helpers_test_clocks_delete_2_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_get_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -36693,7 +27842,7 @@ def test_test_helpers_test_clocks_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.list() + client.test_helpers.test_clocks.list() http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", @@ -36725,7 +27874,7 @@ async def test_test_helpers_test_clocks_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.list_async() + await client.test_helpers.test_clocks.list_async() http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", @@ -36733,26 +27882,6 @@ async def test_test_helpers_test_clocks_get_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_get_2_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -36775,7 +27904,7 @@ def test_test_helpers_test_clocks_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.retrieve("clock_xyz") + client.test_helpers.test_clocks.retrieve("clock_xyz") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xyz", @@ -36807,7 +27936,7 @@ async def test_test_helpers_test_clocks_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.retrieve_async("clock_xyz") + await client.test_helpers.test_clocks.retrieve_async("clock_xyz") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xyz", @@ -36815,27 +27944,6 @@ async def test_test_helpers_test_clocks_get_2_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_get_3_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_get_3( self, http_client_mock: HTTPClientMock ) -> None: @@ -36859,7 +27967,7 @@ def test_test_helpers_test_clocks_get_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.list({"limit": 3}) + client.test_helpers.test_clocks.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", @@ -36892,7 +28000,7 @@ async def test_test_helpers_test_clocks_get_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.list_async({"limit": 3}) + await client.test_helpers.test_clocks.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", @@ -36900,26 +28008,6 @@ async def test_test_helpers_test_clocks_get_3_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_get_4_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_get_4( self, http_client_mock: HTTPClientMock ) -> None: @@ -36942,7 +28030,7 @@ def test_test_helpers_test_clocks_get_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.retrieve("clock_xxxxxxxxxxxxx") + client.test_helpers.test_clocks.retrieve("clock_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", @@ -36976,7 +28064,7 @@ async def test_test_helpers_test_clocks_get_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.retrieve_async( + await client.test_helpers.test_clocks.retrieve_async( "clock_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -36986,32 +28074,6 @@ async def test_test_helpers_test_clocks_get_4_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_test_clocks_post_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -37038,7 +28100,7 @@ def test_test_helpers_test_clocks_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.create( + client.test_helpers.test_clocks.create( { "frozen_time": 123, "name": "cogsworth", @@ -37080,7 +28142,7 @@ async def test_test_helpers_test_clocks_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.create_async( + await client.test_helpers.test_clocks.create_async( { "frozen_time": 123, "name": "cogsworth", @@ -37094,27 +28156,6 @@ async def test_test_helpers_test_clocks_post_service_async( post_data="frozen_time=123&name=cogsworth", ) - def test_test_helpers_test_clocks_post_2_service_non_namespaced( - 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", - ) - def test_test_helpers_test_clocks_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -37138,7 +28179,7 @@ def test_test_helpers_test_clocks_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.test_clocks.create({"frozen_time": 1577836800}) + client.test_helpers.test_clocks.create({"frozen_time": 1577836800}) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", @@ -37174,7 +28215,7 @@ async def test_test_helpers_test_clocks_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.test_clocks.create_async( + await client.test_helpers.test_clocks.create_async( { "frozen_time": 1577836800, } @@ -37187,30 +28228,6 @@ async def test_test_helpers_test_clocks_post_2_service_async( post_data="frozen_time=1577836800", ) - def test_test_helpers_treasury_inbound_transfers_fail_post_service_non_namespaced( - 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", - ) - def test_test_helpers_treasury_inbound_transfers_fail_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -37237,7 +28254,7 @@ def test_test_helpers_treasury_inbound_transfers_fail_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.treasury.inbound_transfers.fail( + client.test_helpers.treasury.inbound_transfers.fail( "ibt_123", {"failure_details": {"code": "account_closed"}}, ) @@ -37277,7 +28294,7 @@ async def test_test_helpers_treasury_inbound_transfers_fail_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.treasury.inbound_transfers.fail_async( + await client.test_helpers.treasury.inbound_transfers.fail_async( "ibt_123", {"failure_details": {"code": "account_closed"}}, ) @@ -37289,28 +28306,6 @@ async def test_test_helpers_treasury_inbound_transfers_fail_post_service_async( post_data="failure_details[code]=account_closed", ) - def test_test_helpers_treasury_inbound_transfers_return_post_service_non_namespaced( - 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", - ) - def test_test_helpers_treasury_inbound_transfers_return_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -37335,8 +28330,8 @@ def test_test_helpers_treasury_inbound_transfers_return_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.treasury.inbound_transfers.return_inbound_transfer( - "ibt_123" + client.test_helpers.treasury.inbound_transfers.return_inbound_transfer( + "ibt_123", ) http_client_mock.assert_requested( "post", @@ -37371,7 +28366,7 @@ async def test_test_helpers_treasury_inbound_transfers_return_post_service_async http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.treasury.inbound_transfers.return_inbound_transfer_async( + await client.test_helpers.treasury.inbound_transfers.return_inbound_transfer_async( "ibt_123" ) http_client_mock.assert_requested( @@ -37381,26 +28376,6 @@ async def test_test_helpers_treasury_inbound_transfers_return_post_service_async api_base="https://api.stripe.com", ) - def test_test_helpers_treasury_inbound_transfers_succeed_post_service_non_namespaced( - 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", - ) - def test_test_helpers_treasury_inbound_transfers_succeed_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -37423,7 +28398,7 @@ def test_test_helpers_treasury_inbound_transfers_succeed_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.treasury.inbound_transfers.succeed("ibt_123") + 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", @@ -37457,7 +28432,7 @@ async def test_test_helpers_treasury_inbound_transfers_succeed_post_service_asyn http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.treasury.inbound_transfers.succeed_async( + await client.test_helpers.treasury.inbound_transfers.succeed_async( "ibt_123", ) http_client_mock.assert_requested( @@ -37467,26 +28442,6 @@ async def test_test_helpers_treasury_inbound_transfers_succeed_post_service_asyn api_base="https://api.stripe.com", ) - def test_test_helpers_treasury_outbound_transfers_fail_post_service_non_namespaced( - 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", - ) - def test_test_helpers_treasury_outbound_transfers_fail_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -37509,7 +28464,7 @@ def test_test_helpers_treasury_outbound_transfers_fail_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.treasury.outbound_transfers.fail("obt_123") + 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", @@ -37543,7 +28498,7 @@ async def test_test_helpers_treasury_outbound_transfers_fail_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.treasury.outbound_transfers.fail_async( + await client.test_helpers.treasury.outbound_transfers.fail_async( "obt_123", ) http_client_mock.assert_requested( @@ -37553,26 +28508,6 @@ async def test_test_helpers_treasury_outbound_transfers_fail_post_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_treasury_outbound_transfers_post_post_service_non_namespaced( - 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", - ) - def test_test_helpers_treasury_outbound_transfers_post_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -37595,7 +28530,7 @@ def test_test_helpers_treasury_outbound_transfers_post_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.treasury.outbound_transfers.post("obt_123") + 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", @@ -37629,7 +28564,7 @@ async def test_test_helpers_treasury_outbound_transfers_post_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.treasury.outbound_transfers.post_async( + await client.test_helpers.treasury.outbound_transfers.post_async( "obt_123", ) http_client_mock.assert_requested( @@ -37639,30 +28574,6 @@ async def test_test_helpers_treasury_outbound_transfers_post_post_service_async( api_base="https://api.stripe.com", ) - def test_test_helpers_treasury_outbound_transfers_return_post_service_non_namespaced( - 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", - ) - def test_test_helpers_treasury_outbound_transfers_return_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -37689,7 +28600,7 @@ def test_test_helpers_treasury_outbound_transfers_return_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.treasury.outbound_transfers.return_outbound_transfer( + client.test_helpers.treasury.outbound_transfers.return_outbound_transfer( "obt_123", {"returned_details": {"code": "account_closed"}}, ) @@ -37729,7 +28640,7 @@ async def test_test_helpers_treasury_outbound_transfers_return_post_service_asyn http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.treasury.outbound_transfers.return_outbound_transfer_async( + await client.test_helpers.treasury.outbound_transfers.return_outbound_transfer_async( "obt_123", {"returned_details": {"code": "account_closed"}}, ) @@ -37741,34 +28652,6 @@ async def test_test_helpers_treasury_outbound_transfers_return_post_service_asyn post_data="returned_details[code]=account_closed", ) - def test_test_helpers_treasury_received_credits_post_service_non_namespaced( - 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", - ) - def test_test_helpers_treasury_received_credits_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -37797,7 +28680,7 @@ def test_test_helpers_treasury_received_credits_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.treasury.received_credits.create( + client.test_helpers.treasury.received_credits.create( { "financial_account": "fa_123", "network": "ach", @@ -37843,7 +28726,7 @@ async def test_test_helpers_treasury_received_credits_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.treasury.received_credits.create_async( + await client.test_helpers.treasury.received_credits.create_async( { "financial_account": "fa_123", "network": "ach", @@ -37859,34 +28742,6 @@ async def test_test_helpers_treasury_received_credits_post_service_async( post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) - def test_test_helpers_treasury_received_debits_post_service_non_namespaced( - 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", - ) - def test_test_helpers_treasury_received_debits_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -37915,7 +28770,7 @@ def test_test_helpers_treasury_received_debits_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.test_helpers.treasury.received_debits.create( + client.test_helpers.treasury.received_debits.create( { "financial_account": "fa_123", "network": "ach", @@ -37961,7 +28816,7 @@ async def test_test_helpers_treasury_received_debits_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.test_helpers.treasury.received_debits.create_async( + await client.test_helpers.treasury.received_debits.create_async( { "financial_account": "fa_123", "network": "ach", @@ -37977,26 +28832,6 @@ async def test_test_helpers_treasury_received_debits_post_service_async( post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) - def test_tokens_get_service_non_namespaced( - 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", - ) - def test_tokens_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.retrieve("tok_xxxx") http_client_mock.assert_requested( @@ -38017,7 +28852,7 @@ def test_tokens_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tokens.retrieve("tok_xxxx") + client.tokens.retrieve("tok_xxxx") http_client_mock.assert_requested( "get", path="/v1/tokens/tok_xxxx", @@ -38049,7 +28884,7 @@ async def test_tokens_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tokens.retrieve_async("tok_xxxx") + await client.tokens.retrieve_async("tok_xxxx") http_client_mock.assert_requested( "get", path="/v1/tokens/tok_xxxx", @@ -38057,36 +28892,6 @@ async def test_tokens_get_service_async( api_base="https://api.stripe.com", ) - def test_tokens_post_service_non_namespaced( - 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", - ) - def test_tokens_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( card={ @@ -38115,7 +28920,7 @@ def test_tokens_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tokens.create( + client.tokens.create( { "card": { "number": "4242424242424242", @@ -38165,7 +28970,7 @@ async def test_tokens_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tokens.create_async( + await client.tokens.create_async( { "card": { "number": "4242424242424242", @@ -38183,38 +28988,6 @@ async def test_tokens_post_service_async( post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", ) - def test_tokens_post_2_service_non_namespaced( - 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", - ) - def test_tokens_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( bank_account={ @@ -38245,7 +29018,7 @@ def test_tokens_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tokens.create( + client.tokens.create( { "bank_account": { "country": "US", @@ -38299,7 +29072,7 @@ async def test_tokens_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tokens.create_async( + await client.tokens.create_async( { "bank_account": { "country": "US", @@ -38319,27 +29092,6 @@ async def test_tokens_post_2_service_async( 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_service_non_namespaced( - 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", - ) - def test_tokens_post_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create(pii={"id_number": "000000000"}) http_client_mock.assert_requested( @@ -38361,7 +29113,7 @@ def test_tokens_post_3_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tokens.create({"pii": {"id_number": "000000000"}}) + client.tokens.create({"pii": {"id_number": "000000000"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", @@ -38395,9 +29147,7 @@ async def test_tokens_post_3_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tokens.create_async( - {"pii": {"id_number": "000000000"}} - ) + await client.tokens.create_async({"pii": {"id_number": "000000000"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", @@ -38406,34 +29156,6 @@ async def test_tokens_post_3_service_async( post_data="pii[id_number]=000000000", ) - def test_tokens_post_4_service_non_namespaced( - 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", - ) - def test_tokens_post_4(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( account={ @@ -38460,7 +29182,7 @@ def test_tokens_post_4_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tokens.create( + client.tokens.create( { "account": { "individual": {"first_name": "Jane", "last_name": "Doe"}, @@ -38506,7 +29228,7 @@ async def test_tokens_post_4_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tokens.create_async( + await client.tokens.create_async( { "account": { "individual": {"first_name": "Jane", "last_name": "Doe"}, @@ -38522,35 +29244,6 @@ async def test_tokens_post_4_service_async( post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=true", ) - def test_tokens_post_5_service_non_namespaced( - 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", - ) - def test_tokens_post_5(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( person={ @@ -38578,7 +29271,7 @@ def test_tokens_post_5_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tokens.create( + client.tokens.create( { "person": { "first_name": "Jane", @@ -38626,7 +29319,7 @@ async def test_tokens_post_5_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tokens.create_async( + await client.tokens.create_async( { "person": { "first_name": "Jane", @@ -38643,27 +29336,6 @@ async def test_tokens_post_5_service_async( post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=true", ) - def test_tokens_post_6_service_non_namespaced( - 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", - ) - def test_tokens_post_6(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create(cvc_update={"cvc": "123"}) http_client_mock.assert_requested( @@ -38685,7 +29357,7 @@ def test_tokens_post_6_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.tokens.create({"cvc_update": {"cvc": "123"}}) + client.tokens.create({"cvc_update": {"cvc": "123"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", @@ -38719,7 +29391,7 @@ async def test_tokens_post_6_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.tokens.create_async({"cvc_update": {"cvc": "123"}}) + await client.tokens.create_async({"cvc_update": {"cvc": "123"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", @@ -38728,26 +29400,6 @@ async def test_tokens_post_6_service_async( post_data="cvc_update[cvc]=123", ) - def test_topups_cancel_post_service_non_namespaced( - 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", - ) - def test_topups_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -38770,7 +29422,7 @@ def test_topups_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.topups.cancel("tu_xxxxxxxxxxxxx") + client.topups.cancel("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", @@ -38802,7 +29454,7 @@ async def test_topups_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.topups.cancel_async("tu_xxxxxxxxxxxxx") + await client.topups.cancel_async("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", @@ -38810,27 +29462,6 @@ async def test_topups_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_topups_get_service_non_namespaced( - 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", - ) - def test_topups_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.list(limit=3) http_client_mock.assert_requested( @@ -38852,7 +29483,7 @@ def test_topups_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.topups.list({"limit": 3}) + client.topups.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/topups", @@ -38885,7 +29516,7 @@ async def test_topups_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.topups.list_async({"limit": 3}) + await client.topups.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/topups", @@ -38893,26 +29524,6 @@ async def test_topups_get_service_async( api_base="https://api.stripe.com", ) - def test_topups_get_2_service_non_namespaced( - 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", - ) - def test_topups_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.retrieve("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -38933,7 +29544,7 @@ def test_topups_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.topups.retrieve("tu_xxxxxxxxxxxxx") + client.topups.retrieve("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/topups/tu_xxxxxxxxxxxxx", @@ -38965,7 +29576,7 @@ async def test_topups_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.topups.retrieve_async("tu_xxxxxxxxxxxxx") + await client.topups.retrieve_async("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/topups/tu_xxxxxxxxxxxxx", @@ -38973,34 +29584,6 @@ async def test_topups_get_2_service_async( api_base="https://api.stripe.com", ) - def test_topups_post_service_non_namespaced( - 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", - ) - def test_topups_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.create( amount=2000, @@ -39027,7 +29610,7 @@ def test_topups_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.topups.create( + client.topups.create( { "amount": 2000, "currency": "usd", @@ -39073,7 +29656,7 @@ async def test_topups_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.topups.create_async( + await client.topups.create_async( { "amount": 2000, "currency": "usd", @@ -39089,30 +29672,6 @@ async def test_topups_post_service_async( post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", ) - def test_topups_post_2_service_non_namespaced( - 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", - ) - def test_topups_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.modify( "tu_xxxxxxxxxxxxx", @@ -39137,7 +29696,7 @@ def test_topups_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.topups.update( + client.topups.update( "tu_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -39177,7 +29736,7 @@ async def test_topups_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.topups.update_async( + await client.topups.update_async( "tu_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -39189,27 +29748,6 @@ async def test_topups_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_transfers_get_service_non_namespaced( - 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", - ) - def test_transfers_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.list(limit=3) http_client_mock.assert_requested( @@ -39231,7 +29769,7 @@ def test_transfers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.transfers.list({"limit": 3}) + client.transfers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/transfers", @@ -39264,7 +29802,7 @@ async def test_transfers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.transfers.list_async({"limit": 3}) + await client.transfers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/transfers", @@ -39272,26 +29810,6 @@ async def test_transfers_get_service_async( api_base="https://api.stripe.com", ) - def test_transfers_get_2_service_non_namespaced( - 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", - ) - def test_transfers_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.retrieve("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( @@ -39312,7 +29830,7 @@ def test_transfers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.transfers.retrieve("tr_xxxxxxxxxxxxx") + client.transfers.retrieve("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx", @@ -39344,7 +29862,7 @@ async def test_transfers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.transfers.retrieve_async("tr_xxxxxxxxxxxxx") + await client.transfers.retrieve_async("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx", @@ -39352,34 +29870,6 @@ async def test_transfers_get_2_service_async( api_base="https://api.stripe.com", ) - def test_transfers_post_service_non_namespaced( - 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", - ) - def test_transfers_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.create( amount=400, @@ -39406,7 +29896,7 @@ def test_transfers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.transfers.create( + client.transfers.create( { "amount": 400, "currency": "usd", @@ -39452,7 +29942,7 @@ async def test_transfers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.transfers.create_async( + await client.transfers.create_async( { "amount": 400, "currency": "usd", @@ -39468,30 +29958,6 @@ async def test_transfers_post_service_async( post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) - def test_transfers_post_2_service_non_namespaced( - 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", - ) - def test_transfers_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.modify( "tr_xxxxxxxxxxxxx", @@ -39516,7 +29982,7 @@ def test_transfers_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.transfers.update( + client.transfers.update( "tr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -39556,7 +30022,7 @@ async def test_transfers_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.transfers.update_async( + await client.transfers.update_async( "tr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -39568,30 +30034,6 @@ async def test_transfers_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_transfers_reversals_get_service_non_namespaced( - 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", - ) - def test_transfers_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -39618,7 +30060,7 @@ def test_transfers_reversals_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.transfers.reversals.list( + client.transfers.reversals.list( "tr_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -39657,7 +30099,7 @@ async def test_transfers_reversals_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.transfers.reversals.list_async( + await client.transfers.reversals.list_async( "tr_xxxxxxxxxxxxx", {"limit": 3}, ) @@ -39668,29 +30110,6 @@ async def test_transfers_reversals_get_service_async( api_base="https://api.stripe.com", ) - def test_transfers_reversals_get_2_service_non_namespaced( - 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", - ) - def test_transfers_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -39716,7 +30135,7 @@ def test_transfers_reversals_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.transfers.reversals.retrieve( + client.transfers.reversals.retrieve( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", ) @@ -39754,7 +30173,7 @@ async def test_transfers_reversals_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.transfers.reversals.retrieve_async( + await client.transfers.reversals.retrieve_async( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", ) @@ -39765,30 +30184,6 @@ async def test_transfers_reversals_get_2_service_async( api_base="https://api.stripe.com", ) - def test_transfers_reversals_post_service_non_namespaced( - 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", - ) - def test_transfers_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -39815,7 +30210,7 @@ def test_transfers_reversals_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.transfers.reversals.create( + client.transfers.reversals.create( "tr_xxxxxxxxxxxxx", {"amount": 100}, ) @@ -39855,7 +30250,7 @@ async def test_transfers_reversals_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.transfers.reversals.create_async( + await client.transfers.reversals.create_async( "tr_xxxxxxxxxxxxx", {"amount": 100}, ) @@ -39867,31 +30262,6 @@ async def test_transfers_reversals_post_service_async( post_data="amount=100", ) - def test_transfers_reversals_post_2_service_non_namespaced( - 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", - ) - def test_transfers_reversals_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -39919,7 +30289,7 @@ def test_transfers_reversals_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.transfers.reversals.update( + client.transfers.reversals.update( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -39961,7 +30331,7 @@ async def test_transfers_reversals_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.transfers.reversals.update_async( + await client.transfers.reversals.update_async( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, @@ -39974,32 +30344,6 @@ async def test_transfers_reversals_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_treasury_credit_reversals_get_service_non_namespaced( - 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", - ) - def test_treasury_credit_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -40026,7 +30370,7 @@ def test_treasury_credit_reversals_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.credit_reversals.list( + client.treasury.credit_reversals.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -40067,7 +30411,7 @@ async def test_treasury_credit_reversals_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.credit_reversals.list_async( + await client.treasury.credit_reversals.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -40080,26 +30424,6 @@ async def test_treasury_credit_reversals_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_credit_reversals_get_2_service_non_namespaced( - 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", - ) - def test_treasury_credit_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -40122,7 +30446,7 @@ def test_treasury_credit_reversals_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.credit_reversals.retrieve("credrev_xxxxxxxxxxxxx") + client.treasury.credit_reversals.retrieve("credrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", @@ -40156,7 +30480,7 @@ async def test_treasury_credit_reversals_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.credit_reversals.retrieve_async( + await client.treasury.credit_reversals.retrieve_async( "credrev_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -40166,31 +30490,6 @@ async def test_treasury_credit_reversals_get_2_service_async( api_base="https://api.stripe.com", ) - def test_treasury_credit_reversals_post_service_non_namespaced( - 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", - ) - def test_treasury_credit_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -40216,7 +30515,7 @@ def test_treasury_credit_reversals_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.credit_reversals.create( + client.treasury.credit_reversals.create( { "received_credit": "rc_xxxxxxxxxxxxx", } @@ -40256,7 +30555,7 @@ async def test_treasury_credit_reversals_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.credit_reversals.create_async( + await client.treasury.credit_reversals.create_async( { "received_credit": "rc_xxxxxxxxxxxxx", } @@ -40269,32 +30568,6 @@ async def test_treasury_credit_reversals_post_service_async( post_data="received_credit=rc_xxxxxxxxxxxxx", ) - def test_treasury_debit_reversals_get_service_non_namespaced( - 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", - ) - def test_treasury_debit_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -40321,7 +30594,7 @@ def test_treasury_debit_reversals_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.debit_reversals.list( + client.treasury.debit_reversals.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -40362,7 +30635,7 @@ async def test_treasury_debit_reversals_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.debit_reversals.list_async( + await client.treasury.debit_reversals.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -40375,26 +30648,6 @@ async def test_treasury_debit_reversals_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_debit_reversals_get_2_service_non_namespaced( - 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", - ) - def test_treasury_debit_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -40417,7 +30670,7 @@ def test_treasury_debit_reversals_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.debit_reversals.retrieve("debrev_xxxxxxxxxxxxx") + client.treasury.debit_reversals.retrieve("debrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", @@ -40451,7 +30704,7 @@ async def test_treasury_debit_reversals_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.debit_reversals.retrieve_async( + await client.treasury.debit_reversals.retrieve_async( "debrev_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -40461,31 +30714,6 @@ async def test_treasury_debit_reversals_get_2_service_async( api_base="https://api.stripe.com", ) - def test_treasury_debit_reversals_post_service_non_namespaced( - 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", - ) - def test_treasury_debit_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -40509,7 +30737,7 @@ def test_treasury_debit_reversals_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.debit_reversals.create( + client.treasury.debit_reversals.create( { "received_debit": "rd_xxxxxxxxxxxxx", } @@ -40549,7 +30777,7 @@ async def test_treasury_debit_reversals_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.debit_reversals.create_async( + await client.treasury.debit_reversals.create_async( { "received_debit": "rd_xxxxxxxxxxxxx", } @@ -40562,28 +30790,6 @@ async def test_treasury_debit_reversals_post_service_async( post_data="received_debit=rd_xxxxxxxxxxxxx", ) - def test_treasury_financial_accounts_features_get_service_non_namespaced( - 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", - ) - def test_treasury_financial_accounts_features_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -40606,8 +30812,8 @@ def test_treasury_financial_accounts_features_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.financial_accounts.features.retrieve( - "fa_xxxxxxxxxxxxx", + client.treasury.financial_accounts.features.retrieve( + "fa_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", @@ -40642,7 +30848,7 @@ async def test_treasury_financial_accounts_features_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.financial_accounts.features.retrieve_async( + await client.treasury.financial_accounts.features.retrieve_async( "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -40652,27 +30858,6 @@ async def test_treasury_financial_accounts_features_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_financial_accounts_get_service_non_namespaced( - 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", - ) - def test_treasury_financial_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -40696,7 +30881,7 @@ def test_treasury_financial_accounts_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.financial_accounts.list({"limit": 3}) + client.treasury.financial_accounts.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts", @@ -40729,7 +30914,7 @@ async def test_treasury_financial_accounts_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.financial_accounts.list_async({"limit": 3}) + await client.treasury.financial_accounts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts", @@ -40737,26 +30922,6 @@ async def test_treasury_financial_accounts_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_financial_accounts_get_2_service_non_namespaced( - 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", - ) - def test_treasury_financial_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -40779,7 +30944,7 @@ def test_treasury_financial_accounts_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.financial_accounts.retrieve("fa_xxxxxxxxxxxxx") + client.treasury.financial_accounts.retrieve("fa_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", @@ -40813,7 +30978,7 @@ async def test_treasury_financial_accounts_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.financial_accounts.retrieve_async( + await client.treasury.financial_accounts.retrieve_async( "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -40823,32 +30988,6 @@ async def test_treasury_financial_accounts_get_2_service_async( api_base="https://api.stripe.com", ) - def test_treasury_financial_accounts_post_service_non_namespaced( - 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", - ) - def test_treasury_financial_accounts_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -40875,7 +31014,7 @@ def test_treasury_financial_accounts_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.financial_accounts.create( + client.treasury.financial_accounts.create( { "supported_currencies": ["usd"], "features": {}, @@ -40917,7 +31056,7 @@ async def test_treasury_financial_accounts_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.financial_accounts.create_async( + await client.treasury.financial_accounts.create_async( { "supported_currencies": ["usd"], "features": {}, @@ -40931,30 +31070,6 @@ async def test_treasury_financial_accounts_post_service_async( post_data="supported_currencies[0]=usd", ) - def test_treasury_financial_accounts_post_2_service_non_namespaced( - 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", - ) - def test_treasury_financial_accounts_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -40981,7 +31096,7 @@ def test_treasury_financial_accounts_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.financial_accounts.update( + client.treasury.financial_accounts.update( "fa_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -41021,7 +31136,7 @@ async def test_treasury_financial_accounts_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.financial_accounts.update_async( + await client.treasury.financial_accounts.update_async( "fa_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) @@ -41033,26 +31148,6 @@ async def test_treasury_financial_accounts_post_2_service_async( post_data="metadata[order_id]=6735", ) - def test_treasury_inbound_transfers_cancel_post_service_non_namespaced( - 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", - ) - def test_treasury_inbound_transfers_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -41075,7 +31170,7 @@ def test_treasury_inbound_transfers_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.inbound_transfers.cancel("ibt_xxxxxxxxxxxxx") + client.treasury.inbound_transfers.cancel("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", @@ -41107,7 +31202,7 @@ async def test_treasury_inbound_transfers_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.inbound_transfers.cancel_async( + await client.treasury.inbound_transfers.cancel_async( "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -41117,32 +31212,6 @@ async def test_treasury_inbound_transfers_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_treasury_inbound_transfers_get_service_non_namespaced( - 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", - ) - def test_treasury_inbound_transfers_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -41169,7 +31238,7 @@ def test_treasury_inbound_transfers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.inbound_transfers.list( + client.treasury.inbound_transfers.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -41210,7 +31279,7 @@ async def test_treasury_inbound_transfers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.inbound_transfers.list_async( + await client.treasury.inbound_transfers.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -41223,26 +31292,6 @@ async def test_treasury_inbound_transfers_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_inbound_transfers_get_2_service_non_namespaced( - 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", - ) - def test_treasury_inbound_transfers_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -41265,7 +31314,7 @@ def test_treasury_inbound_transfers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.inbound_transfers.retrieve("ibt_xxxxxxxxxxxxx") + client.treasury.inbound_transfers.retrieve("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", @@ -41299,7 +31348,7 @@ async def test_treasury_inbound_transfers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.inbound_transfers.retrieve_async( + await client.treasury.inbound_transfers.retrieve_async( "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -41309,35 +31358,6 @@ async def test_treasury_inbound_transfers_get_2_service_async( api_base="https://api.stripe.com", ) - def test_treasury_inbound_transfers_post_service_non_namespaced( - 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", - ) - def test_treasury_inbound_transfers_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -41367,7 +31387,7 @@ def test_treasury_inbound_transfers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.inbound_transfers.create( + client.treasury.inbound_transfers.create( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, @@ -41415,7 +31435,7 @@ async def test_treasury_inbound_transfers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.inbound_transfers.create_async( + await client.treasury.inbound_transfers.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, @@ -41432,26 +31452,6 @@ async def test_treasury_inbound_transfers_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_treasury_outbound_payments_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -41474,7 +31474,7 @@ def test_treasury_outbound_payments_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.outbound_payments.cancel("bot_xxxxxxxxxxxxx") + client.treasury.outbound_payments.cancel("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", @@ -41506,7 +31506,7 @@ async def test_treasury_outbound_payments_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.outbound_payments.cancel_async( + await client.treasury.outbound_payments.cancel_async( "bot_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -41516,32 +31516,6 @@ async def test_treasury_outbound_payments_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_treasury_outbound_payments_get_service_non_namespaced( - 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", - ) - def test_treasury_outbound_payments_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -41568,7 +31542,7 @@ def test_treasury_outbound_payments_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.outbound_payments.list( + client.treasury.outbound_payments.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -41609,7 +31583,7 @@ async def test_treasury_outbound_payments_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.outbound_payments.list_async( + await client.treasury.outbound_payments.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -41622,26 +31596,6 @@ async def test_treasury_outbound_payments_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_outbound_payments_get_2_service_non_namespaced( - 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", - ) - def test_treasury_outbound_payments_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -41664,7 +31618,7 @@ def test_treasury_outbound_payments_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.outbound_payments.retrieve("bot_xxxxxxxxxxxxx") + client.treasury.outbound_payments.retrieve("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", @@ -41698,7 +31652,7 @@ async def test_treasury_outbound_payments_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.outbound_payments.retrieve_async( + await client.treasury.outbound_payments.retrieve_async( "bot_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -41708,36 +31662,6 @@ async def test_treasury_outbound_payments_get_2_service_async( api_base="https://api.stripe.com", ) - def test_treasury_outbound_payments_post_service_non_namespaced( - 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", - ) - def test_treasury_outbound_payments_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -41768,7 +31692,7 @@ def test_treasury_outbound_payments_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.outbound_payments.create( + client.treasury.outbound_payments.create( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, @@ -41818,7 +31742,7 @@ async def test_treasury_outbound_payments_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.outbound_payments.create_async( + await client.treasury.outbound_payments.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, @@ -41836,26 +31760,6 @@ async def test_treasury_outbound_payments_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_treasury_outbound_transfers_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -41878,7 +31782,7 @@ def test_treasury_outbound_transfers_cancel_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.outbound_transfers.cancel("obt_xxxxxxxxxxxxx") + client.treasury.outbound_transfers.cancel("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", @@ -41912,7 +31816,7 @@ async def test_treasury_outbound_transfers_cancel_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.outbound_transfers.cancel_async( + await client.treasury.outbound_transfers.cancel_async( "obt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -41922,32 +31826,6 @@ async def test_treasury_outbound_transfers_cancel_post_service_async( api_base="https://api.stripe.com", ) - def test_treasury_outbound_transfers_get_service_non_namespaced( - 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", - ) - def test_treasury_outbound_transfers_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -41974,7 +31852,7 @@ def test_treasury_outbound_transfers_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.outbound_transfers.list( + client.treasury.outbound_transfers.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42015,7 +31893,7 @@ async def test_treasury_outbound_transfers_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.outbound_transfers.list_async( + await client.treasury.outbound_transfers.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42028,26 +31906,6 @@ async def test_treasury_outbound_transfers_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_outbound_transfers_get_2_service_non_namespaced( - 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", - ) - def test_treasury_outbound_transfers_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -42070,7 +31928,7 @@ def test_treasury_outbound_transfers_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.outbound_transfers.retrieve("obt_xxxxxxxxxxxxx") + client.treasury.outbound_transfers.retrieve("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", @@ -42104,7 +31962,7 @@ async def test_treasury_outbound_transfers_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.outbound_transfers.retrieve_async( + await client.treasury.outbound_transfers.retrieve_async( "obt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -42114,35 +31972,6 @@ async def test_treasury_outbound_transfers_get_2_service_async( api_base="https://api.stripe.com", ) - def test_treasury_outbound_transfers_post_service_non_namespaced( - 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", - ) - def test_treasury_outbound_transfers_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -42172,7 +32001,7 @@ def test_treasury_outbound_transfers_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.outbound_transfers.create( + client.treasury.outbound_transfers.create( { "financial_account": "fa_xxxxxxxxxxxxx", "destination_payment_method": "pm_xxxxxxxxxxxxx", @@ -42220,7 +32049,7 @@ async def test_treasury_outbound_transfers_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.outbound_transfers.create_async( + await client.treasury.outbound_transfers.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", "destination_payment_method": "pm_xxxxxxxxxxxxx", @@ -42237,32 +32066,6 @@ async def test_treasury_outbound_transfers_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_treasury_received_credits_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -42289,7 +32092,7 @@ def test_treasury_received_credits_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.received_credits.list( + client.treasury.received_credits.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42330,7 +32133,7 @@ async def test_treasury_received_credits_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.received_credits.list_async( + await client.treasury.received_credits.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42343,26 +32146,6 @@ async def test_treasury_received_credits_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_received_credits_get_2_service_non_namespaced( - 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", - ) - def test_treasury_received_credits_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -42385,7 +32168,7 @@ def test_treasury_received_credits_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.received_credits.retrieve("rc_xxxxxxxxxxxxx") + client.treasury.received_credits.retrieve("rc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", @@ -42417,7 +32200,7 @@ async def test_treasury_received_credits_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.received_credits.retrieve_async( + await client.treasury.received_credits.retrieve_async( "rc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -42427,32 +32210,6 @@ async def test_treasury_received_credits_get_2_service_async( api_base="https://api.stripe.com", ) - def test_treasury_received_debits_get_service_non_namespaced( - 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", - ) - def test_treasury_received_debits_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -42479,7 +32236,7 @@ def test_treasury_received_debits_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.received_debits.list( + client.treasury.received_debits.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42520,7 +32277,7 @@ async def test_treasury_received_debits_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.received_debits.list_async( + await client.treasury.received_debits.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42533,26 +32290,6 @@ async def test_treasury_received_debits_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_received_debits_get_2_service_non_namespaced( - 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", - ) - def test_treasury_received_debits_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -42575,7 +32312,7 @@ def test_treasury_received_debits_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.received_debits.retrieve("rd_xxxxxxxxxxxxx") + client.treasury.received_debits.retrieve("rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", @@ -42607,8 +32344,8 @@ async def test_treasury_received_debits_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.received_debits.retrieve_async( - "rd_xxxxxxxxxxxxx", + await client.treasury.received_debits.retrieve_async( + "rd_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", @@ -42617,32 +32354,6 @@ async def test_treasury_received_debits_get_2_service_async( api_base="https://api.stripe.com", ) - def test_treasury_transaction_entries_get_service_non_namespaced( - 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", - ) - def test_treasury_transaction_entries_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -42669,7 +32380,7 @@ def test_treasury_transaction_entries_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.transaction_entries.list( + client.treasury.transaction_entries.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42710,7 +32421,7 @@ async def test_treasury_transaction_entries_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.transaction_entries.list_async( + await client.treasury.transaction_entries.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42723,26 +32434,6 @@ async def test_treasury_transaction_entries_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_transaction_entries_get_2_service_non_namespaced( - 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", - ) - def test_treasury_transaction_entries_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -42765,7 +32456,7 @@ def test_treasury_transaction_entries_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.transaction_entries.retrieve("trxne_xxxxxxxxxxxxx") + client.treasury.transaction_entries.retrieve("trxne_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", @@ -42799,7 +32490,7 @@ async def test_treasury_transaction_entries_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.transaction_entries.retrieve_async( + await client.treasury.transaction_entries.retrieve_async( "trxne_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( @@ -42809,32 +32500,6 @@ async def test_treasury_transaction_entries_get_2_service_async( api_base="https://api.stripe.com", ) - def test_treasury_transactions_get_service_non_namespaced( - 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", - ) - def test_treasury_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -42861,7 +32526,7 @@ def test_treasury_transactions_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.transactions.list( + client.treasury.transactions.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42902,7 +32567,7 @@ async def test_treasury_transactions_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.transactions.list_async( + await client.treasury.transactions.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, @@ -42915,26 +32580,6 @@ async def test_treasury_transactions_get_service_async( api_base="https://api.stripe.com", ) - def test_treasury_transactions_get_2_service_non_namespaced( - 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", - ) - def test_treasury_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -42957,7 +32602,7 @@ def test_treasury_transactions_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.treasury.transactions.retrieve("trxn_xxxxxxxxxxxxx") + client.treasury.transactions.retrieve("trxn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", @@ -42989,9 +32634,7 @@ async def test_treasury_transactions_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.treasury.transactions.retrieve_async( - "trxn_xxxxxxxxxxxxx", - ) + await client.treasury.transactions.retrieve_async("trxn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", @@ -42999,26 +32642,6 @@ async def test_treasury_transactions_get_2_service_async( api_base="https://api.stripe.com", ) - def test_webhook_endpoints_delete_service_non_namespaced( - 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", - ) - def test_webhook_endpoints_delete( self, http_client_mock: HTTPClientMock ) -> None: @@ -43041,7 +32664,7 @@ def test_webhook_endpoints_delete_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.webhook_endpoints.delete("we_xxxxxxxxxxxxx") + client.webhook_endpoints.delete("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", @@ -43073,7 +32696,7 @@ async def test_webhook_endpoints_delete_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.webhook_endpoints.delete_async("we_xxxxxxxxxxxxx") + await client.webhook_endpoints.delete_async("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", @@ -43081,27 +32704,6 @@ async def test_webhook_endpoints_delete_service_async( api_base="https://api.stripe.com", ) - def test_webhook_endpoints_get_service_non_namespaced( - 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", - ) - def test_webhook_endpoints_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -43125,7 +32727,7 @@ def test_webhook_endpoints_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.webhook_endpoints.list({"limit": 3}) + client.webhook_endpoints.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints", @@ -43158,7 +32760,7 @@ async def test_webhook_endpoints_get_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.webhook_endpoints.list_async({"limit": 3}) + await client.webhook_endpoints.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints", @@ -43166,26 +32768,6 @@ async def test_webhook_endpoints_get_service_async( api_base="https://api.stripe.com", ) - def test_webhook_endpoints_get_2_service_non_namespaced( - 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", - ) - def test_webhook_endpoints_get_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -43208,7 +32790,7 @@ def test_webhook_endpoints_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.webhook_endpoints.retrieve("we_xxxxxxxxxxxxx") + client.webhook_endpoints.retrieve("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", @@ -43240,7 +32822,7 @@ async def test_webhook_endpoints_get_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.webhook_endpoints.retrieve_async("we_xxxxxxxxxxxxx") + await client.webhook_endpoints.retrieve_async("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", @@ -43248,32 +32830,6 @@ async def test_webhook_endpoints_get_2_service_async( api_base="https://api.stripe.com", ) - def test_webhook_endpoints_post_service_non_namespaced( - 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", - ) - def test_webhook_endpoints_post( self, http_client_mock: HTTPClientMock ) -> None: @@ -43300,7 +32856,7 @@ def test_webhook_endpoints_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.webhook_endpoints.create( + client.webhook_endpoints.create( { "url": "https://example.com/my/webhook/endpoint", "enabled_events": ["charge.failed", "charge.succeeded"], @@ -43342,7 +32898,7 @@ async def test_webhook_endpoints_post_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.webhook_endpoints.create_async( + await client.webhook_endpoints.create_async( { "url": "https://example.com/my/webhook/endpoint", "enabled_events": ["charge.failed", "charge.succeeded"], @@ -43356,30 +32912,6 @@ async def test_webhook_endpoints_post_service_async( 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_service_non_namespaced( - 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", - ) - def test_webhook_endpoints_post_2( self, http_client_mock: HTTPClientMock ) -> None: @@ -43406,7 +32938,7 @@ def test_webhook_endpoints_post_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v1.webhook_endpoints.update( + client.webhook_endpoints.update( "we_xxxxxxxxxxxxx", {"url": "https://example.com/new_endpoint"}, ) @@ -43446,7 +32978,7 @@ async def test_webhook_endpoints_post_2_service_async( http_client=http_client_mock.get_mock_http_client(), ) - await client.v1.webhook_endpoints.update_async( + await client.webhook_endpoints.update_async( "we_xxxxxxxxxxxxx", {"url": "https://example.com/new_endpoint"}, ) From 350fc131878aa1dab54a328c0e604df53dcaf202 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 15:10:11 +0000 Subject: [PATCH 3/8] Update generated code for v1796 and 2025-05-28.basil --- OPENAPI_VERSION | 2 +- stripe/_api_version.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index da86bc739..3dad0942d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1789 \ No newline at end of file +v1796 \ No newline at end of file diff --git a/stripe/_api_version.py b/stripe/_api_version.py index bced0a8d9..225ed99aa 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -2,3 +2,5 @@ # File generated from our OpenAPI spec class _ApiVersion: CURRENT = "2025-05-28.basil" + CURRENT_MAJOR = "basil" + CURRENT_MONTHLY = "2025-05-28" From 25a245a6256b7d09ca2dfaad9542804e6c69ea05 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 17:59:42 +0000 Subject: [PATCH 4/8] Update generated code for v1800 and 2025-05-28.basil --- OPENAPI_VERSION | 2 +- stripe/_api_version.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3dad0942d..ad4294e18 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1796 \ No newline at end of file +v1800 \ No newline at end of file diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 225ed99aa..442d12055 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -3,4 +3,3 @@ class _ApiVersion: CURRENT = "2025-05-28.basil" CURRENT_MAJOR = "basil" - CURRENT_MONTHLY = "2025-05-28" From 918eba2ed5ce1fa2ac0724387e7f388f905867ea Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Fri, 20 Jun 2025 19:38:41 -0400 Subject: [PATCH 5/8] Removed generated deprecated method --- stripe/_stripe_client.py | 481 --------------------------------------- 1 file changed, 481 deletions(-) diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 9d78728bf..e39f39534 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -372,485 +372,4 @@ def deserialize( ) # deprecated v1 services: The beginning of the section generated from our OpenAPI spec - @property - @deprecated( - "stripe_client.accounts is deprecated. Use stripe_client.v1.accounts.", - ) - def accounts(self) -> AccountService: - return self.v1.accounts - - @property - @deprecated( - "stripe_client.account_links is deprecated. Use stripe_client.v1.account_links.", - ) - def account_links(self) -> AccountLinkService: - return self.v1.account_links - - @property - @deprecated( - "stripe_client.account_sessions is deprecated. Use stripe_client.v1.account_sessions.", - ) - def account_sessions(self) -> AccountSessionService: - return self.v1.account_sessions - - @property - @deprecated( - "stripe_client.apple_pay_domains is deprecated. Use stripe_client.v1.apple_pay_domains.", - ) - def apple_pay_domains(self) -> ApplePayDomainService: - return self.v1.apple_pay_domains - - @property - @deprecated( - "stripe_client.application_fees is deprecated. Use stripe_client.v1.application_fees.", - ) - def application_fees(self) -> ApplicationFeeService: - return self.v1.application_fees - - @property - @deprecated("stripe_client.apps is deprecated. Use stripe_client.v1.apps.") - def apps(self) -> AppsService: - return self.v1.apps - - @property - @deprecated( - "stripe_client.balance is deprecated. Use stripe_client.v1.balance.", - ) - def balance(self) -> BalanceService: - return self.v1.balance - - @property - @deprecated( - "stripe_client.balance_transactions is deprecated. Use stripe_client.v1.balance_transactions.", - ) - def balance_transactions(self) -> BalanceTransactionService: - return self.v1.balance_transactions - - @property - @deprecated( - "stripe_client.billing is deprecated. Use stripe_client.v1.billing.", - ) - def billing(self) -> BillingService: - return self.v1.billing - - @property - @deprecated( - "stripe_client.billing_portal is deprecated. Use stripe_client.v1.billing_portal.", - ) - def billing_portal(self) -> BillingPortalService: - return self.v1.billing_portal - - @property - @deprecated( - "stripe_client.charges is deprecated. Use stripe_client.v1.charges.", - ) - def charges(self) -> ChargeService: - return self.v1.charges - - @property - @deprecated( - "stripe_client.checkout is deprecated. Use stripe_client.v1.checkout.", - ) - def checkout(self) -> CheckoutService: - return self.v1.checkout - - @property - @deprecated( - "stripe_client.climate is deprecated. Use stripe_client.v1.climate.", - ) - def climate(self) -> ClimateService: - return self.v1.climate - - @property - @deprecated( - "stripe_client.confirmation_tokens is deprecated. Use stripe_client.v1.confirmation_tokens.", - ) - def confirmation_tokens(self) -> ConfirmationTokenService: - return self.v1.confirmation_tokens - - @property - @deprecated( - "stripe_client.test_helpers is deprecated. Use stripe_client.v1.test_helpers.", - ) - def test_helpers(self) -> TestHelpersService: - return self.v1.test_helpers - - @property - @deprecated( - "stripe_client.country_specs is deprecated. Use stripe_client.v1.country_specs.", - ) - def country_specs(self) -> CountrySpecService: - return self.v1.country_specs - - @property - @deprecated( - "stripe_client.coupons is deprecated. Use stripe_client.v1.coupons.", - ) - def coupons(self) -> CouponService: - return self.v1.coupons - - @property - @deprecated( - "stripe_client.credit_notes is deprecated. Use stripe_client.v1.credit_notes.", - ) - def credit_notes(self) -> CreditNoteService: - return self.v1.credit_notes - - @property - @deprecated( - "stripe_client.customers is deprecated. Use stripe_client.v1.customers.", - ) - def customers(self) -> CustomerService: - return self.v1.customers - - @property - @deprecated( - "stripe_client.customer_sessions is deprecated. Use stripe_client.v1.customer_sessions.", - ) - def customer_sessions(self) -> CustomerSessionService: - return self.v1.customer_sessions - - @property - @deprecated( - "stripe_client.disputes is deprecated. Use stripe_client.v1.disputes.", - ) - def disputes(self) -> DisputeService: - return self.v1.disputes - - @property - @deprecated( - "stripe_client.entitlements is deprecated. Use stripe_client.v1.entitlements.", - ) - def entitlements(self) -> EntitlementsService: - return self.v1.entitlements - - @property - @deprecated( - "stripe_client.ephemeral_keys is deprecated. Use stripe_client.v1.ephemeral_keys.", - ) - def ephemeral_keys(self) -> EphemeralKeyService: - return self.v1.ephemeral_keys - - @property - @deprecated( - "stripe_client.events is deprecated. Use stripe_client.v1.events." - ) - def events(self) -> EventService: - return self.v1.events - - @property - @deprecated( - "stripe_client.exchange_rates is deprecated. Use stripe_client.v1.exchange_rates.", - ) - def exchange_rates(self) -> ExchangeRateService: - return self.v1.exchange_rates - - @property - @deprecated( - "stripe_client.files is deprecated. Use stripe_client.v1.files." - ) - def files(self) -> FileService: - return self.v1.files - - @property - @deprecated( - "stripe_client.file_links is deprecated. Use stripe_client.v1.file_links.", - ) - def file_links(self) -> FileLinkService: - return self.v1.file_links - - @property - @deprecated( - "stripe_client.financial_connections is deprecated. Use stripe_client.v1.financial_connections.", - ) - def financial_connections(self) -> FinancialConnectionsService: - return self.v1.financial_connections - - @property - @deprecated( - "stripe_client.forwarding is deprecated. Use stripe_client.v1.forwarding.", - ) - def forwarding(self) -> ForwardingService: - return self.v1.forwarding - - @property - @deprecated( - "stripe_client.identity is deprecated. Use stripe_client.v1.identity.", - ) - def identity(self) -> IdentityService: - return self.v1.identity - - @property - @deprecated( - "stripe_client.invoices is deprecated. Use stripe_client.v1.invoices.", - ) - def invoices(self) -> InvoiceService: - return self.v1.invoices - - @property - @deprecated( - "stripe_client.invoice_payments is deprecated. Use stripe_client.v1.invoice_payments.", - ) - def invoice_payments(self) -> InvoicePaymentService: - return self.v1.invoice_payments - - @property - @deprecated( - "stripe_client.invoice_rendering_templates is deprecated. Use stripe_client.v1.invoice_rendering_templates.", - ) - def invoice_rendering_templates(self) -> InvoiceRenderingTemplateService: - return self.v1.invoice_rendering_templates - - @property - @deprecated( - "stripe_client.invoice_items is deprecated. Use stripe_client.v1.invoice_items.", - ) - def invoice_items(self) -> InvoiceItemService: - return self.v1.invoice_items - - @property - @deprecated( - "stripe_client.issuing is deprecated. Use stripe_client.v1.issuing.", - ) - def issuing(self) -> IssuingService: - return self.v1.issuing - - @property - @deprecated( - "stripe_client.mandates is deprecated. Use stripe_client.v1.mandates.", - ) - def mandates(self) -> MandateService: - return self.v1.mandates - - @property - @deprecated( - "stripe_client.payment_intents is deprecated. Use stripe_client.v1.payment_intents.", - ) - def payment_intents(self) -> PaymentIntentService: - return self.v1.payment_intents - - @property - @deprecated( - "stripe_client.payment_links is deprecated. Use stripe_client.v1.payment_links.", - ) - def payment_links(self) -> PaymentLinkService: - return self.v1.payment_links - - @property - @deprecated( - "stripe_client.payment_methods is deprecated. Use stripe_client.v1.payment_methods.", - ) - def payment_methods(self) -> PaymentMethodService: - return self.v1.payment_methods - - @property - @deprecated( - "stripe_client.payment_method_configurations is deprecated. Use stripe_client.v1.payment_method_configurations.", - ) - def payment_method_configurations( - self, - ) -> PaymentMethodConfigurationService: - return self.v1.payment_method_configurations - - @property - @deprecated( - "stripe_client.payment_method_domains is deprecated. Use stripe_client.v1.payment_method_domains.", - ) - def payment_method_domains(self) -> PaymentMethodDomainService: - return self.v1.payment_method_domains - - @property - @deprecated( - "stripe_client.payouts is deprecated. Use stripe_client.v1.payouts.", - ) - def payouts(self) -> PayoutService: - return self.v1.payouts - - @property - @deprecated( - "stripe_client.plans is deprecated. Use stripe_client.v1.plans." - ) - def plans(self) -> PlanService: - return self.v1.plans - - @property - @deprecated( - "stripe_client.prices is deprecated. Use stripe_client.v1.prices." - ) - def prices(self) -> PriceService: - return self.v1.prices - - @property - @deprecated( - "stripe_client.products is deprecated. Use stripe_client.v1.products.", - ) - def products(self) -> ProductService: - return self.v1.products - - @property - @deprecated( - "stripe_client.promotion_codes is deprecated. Use stripe_client.v1.promotion_codes.", - ) - def promotion_codes(self) -> PromotionCodeService: - return self.v1.promotion_codes - - @property - @deprecated( - "stripe_client.quotes is deprecated. Use stripe_client.v1.quotes." - ) - def quotes(self) -> QuoteService: - return self.v1.quotes - - @property - @deprecated( - "stripe_client.radar is deprecated. Use stripe_client.v1.radar." - ) - def radar(self) -> RadarService: - return self.v1.radar - - @property - @deprecated( - "stripe_client.refunds is deprecated. Use stripe_client.v1.refunds.", - ) - def refunds(self) -> RefundService: - return self.v1.refunds - - @property - @deprecated( - "stripe_client.reporting is deprecated. Use stripe_client.v1.reporting.", - ) - def reporting(self) -> ReportingService: - return self.v1.reporting - - @property - @deprecated( - "stripe_client.reviews is deprecated. Use stripe_client.v1.reviews.", - ) - def reviews(self) -> ReviewService: - return self.v1.reviews - - @property - @deprecated( - "stripe_client.sigma is deprecated. Use stripe_client.v1.sigma." - ) - def sigma(self) -> SigmaService: - return self.v1.sigma - - @property - @deprecated( - "stripe_client.setup_attempts is deprecated. Use stripe_client.v1.setup_attempts.", - ) - def setup_attempts(self) -> SetupAttemptService: - return self.v1.setup_attempts - - @property - @deprecated( - "stripe_client.setup_intents is deprecated. Use stripe_client.v1.setup_intents.", - ) - def setup_intents(self) -> SetupIntentService: - return self.v1.setup_intents - - @property - @deprecated( - "stripe_client.shipping_rates is deprecated. Use stripe_client.v1.shipping_rates.", - ) - def shipping_rates(self) -> ShippingRateService: - return self.v1.shipping_rates - - @property - @deprecated( - "stripe_client.sources is deprecated. Use stripe_client.v1.sources.", - ) - def sources(self) -> SourceService: - return self.v1.sources - - @property - @deprecated( - "stripe_client.subscriptions is deprecated. Use stripe_client.v1.subscriptions.", - ) - def subscriptions(self) -> SubscriptionService: - return self.v1.subscriptions - - @property - @deprecated( - "stripe_client.subscription_items is deprecated. Use stripe_client.v1.subscription_items.", - ) - def subscription_items(self) -> SubscriptionItemService: - return self.v1.subscription_items - - @property - @deprecated( - "stripe_client.subscription_schedules is deprecated. Use stripe_client.v1.subscription_schedules.", - ) - def subscription_schedules(self) -> SubscriptionScheduleService: - return self.v1.subscription_schedules - - @property - @deprecated("stripe_client.tax is deprecated. Use stripe_client.v1.tax.") - def tax(self) -> TaxService: - return self.v1.tax - - @property - @deprecated( - "stripe_client.tax_codes is deprecated. Use stripe_client.v1.tax_codes.", - ) - def tax_codes(self) -> TaxCodeService: - return self.v1.tax_codes - - @property - @deprecated( - "stripe_client.tax_ids is deprecated. Use stripe_client.v1.tax_ids.", - ) - def tax_ids(self) -> TaxIdService: - return self.v1.tax_ids - - @property - @deprecated( - "stripe_client.tax_rates is deprecated. Use stripe_client.v1.tax_rates.", - ) - def tax_rates(self) -> TaxRateService: - return self.v1.tax_rates - - @property - @deprecated( - "stripe_client.terminal is deprecated. Use stripe_client.v1.terminal.", - ) - def terminal(self) -> TerminalService: - return self.v1.terminal - - @property - @deprecated( - "stripe_client.tokens is deprecated. Use stripe_client.v1.tokens." - ) - def tokens(self) -> TokenService: - return self.v1.tokens - - @property - @deprecated( - "stripe_client.topups is deprecated. Use stripe_client.v1.topups." - ) - def topups(self) -> TopupService: - return self.v1.topups - - @property - @deprecated( - "stripe_client.transfers is deprecated. Use stripe_client.v1.transfers.", - ) - def transfers(self) -> TransferService: - return self.v1.transfers - - @property - @deprecated( - "stripe_client.treasury is deprecated. Use stripe_client.v1.treasury.", - ) - def treasury(self) -> TreasuryService: - return self.v1.treasury - - @property - @deprecated( - "stripe_client.webhook_endpoints is deprecated. Use stripe_client.v1.webhook_endpoints.", - ) - def webhook_endpoints(self) -> WebhookEndpointService: - return self.v1.webhook_endpoints - # deprecated v1 services: The end of the section generated from our OpenAPI spec From 1e06025fbfbd94878f7572a3c555ad50bc510765 Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Fri, 20 Jun 2025 19:43:31 -0400 Subject: [PATCH 6/8] Ignore deprecated import --- stripe/_stripe_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index e39f39534..e6fb417c9 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -24,7 +24,7 @@ from stripe._api_version import _ApiVersion from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse -from stripe._util import _convert_to_stripe_object, get_api_mode, deprecated +from stripe._util import _convert_to_stripe_object, get_api_mode, deprecated # noqa: F401 from stripe._webhook import Webhook, WebhookSignature from stripe._event import Event from stripe.v2._event import ThinEvent From 614c85be1a7a9b5065ad5c4e8ad829cfe18a9277 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 16:07:11 +0000 Subject: [PATCH 7/8] Update generated code for v1819 and 2025-06-30.basil --- API_VERSION | 2 +- OPENAPI_VERSION | 2 +- stripe/_account.py | 71 +++ stripe/_account_service.py | 91 ++++ stripe/_account_session.py | 158 +++---- stripe/_account_session_service.py | 96 ++-- stripe/_api_version.py | 2 +- stripe/_charge.py | 54 ++- stripe/_confirmation_token.py | 45 +- stripe/_credit_note.py | 18 +- stripe/_credit_note_preview_lines_service.py | 6 +- stripe/_credit_note_service.py | 12 +- stripe/_customer.py | 1 + stripe/_customer_payment_method_service.py | 1 + stripe/_customer_session.py | 4 +- stripe/_customer_session_service.py | 2 +- stripe/_dispute.py | 6 +- stripe/_event.py | 3 +- stripe/_invoice.py | 33 +- stripe/_invoice_item.py | 5 +- stripe/_invoice_service.py | 32 +- stripe/_mandate.py | 5 + stripe/_payment_intent.py | 361 +++++++++++++- stripe/_payment_intent_service.py | 333 ++++++++++++- stripe/_payment_method.py | 36 +- stripe/_payment_method_service.py | 10 + stripe/_quote.py | 24 +- stripe/_quote_service.py | 13 +- stripe/_setup_attempt.py | 4 +- stripe/_setup_intent.py | 444 +++++++++++++++++- stripe/_setup_intent_service.py | 436 ++++++++++++++++- stripe/_subscription.py | 162 ++++++- stripe/_subscription_schedule.py | 24 + stripe/_subscription_schedule_service.py | 9 + stripe/_subscription_service.py | 78 ++- stripe/_token.py | 3 + stripe/_token_service.py | 3 + stripe/_webhook_endpoint.py | 3 + stripe/_webhook_endpoint_service.py | 3 + stripe/billing_portal/_session.py | 4 +- stripe/billing_portal/_session_service.py | 2 +- stripe/checkout/_session.py | 59 ++- stripe/checkout/_session_service.py | 59 ++- stripe/identity/_verification_session.py | 40 ++ .../identity/_verification_session_service.py | 16 + stripe/tax/_registration.py | 18 + stripe/tax/_registration_service.py | 10 + stripe/terminal/_configuration.py | 1 + stripe/terminal/_location.py | 2 +- stripe/terminal/_location_service.py | 2 +- stripe/terminal/_reader.py | 364 +++++++++++++- stripe/terminal/_reader_service.py | 154 ++++++ .../_confirmation_token_service.py | 15 +- stripe/treasury/_financial_account.py | 4 + stripe/treasury/_financial_account_service.py | 4 + 55 files changed, 3062 insertions(+), 287 deletions(-) diff --git a/API_VERSION b/API_VERSION index 41f75f9ac..1116f63c2 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -2025-05-28.basil \ No newline at end of file +2025-06-30.basil \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ad4294e18..d8931ef8a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1800 \ No newline at end of file +v1819 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 0cd137a47..98bdb9fa3 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -242,6 +242,10 @@ class Capabilities(StripeObject): """ The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. """ + crypto_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Crypto capability of the account, or whether the account can directly process Crypto payments. + """ eps_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. @@ -1235,10 +1239,30 @@ class Schedule(StripeObject): """ The day of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. """ + monthly_payout_days: Optional[List[int]] + """ + The days of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. + """ weekly_anchor: Optional[str] """ The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. Only shown if `interval` is weekly. """ + weekly_payout_days: Optional[ + List[ + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] + ] + ] + """ + The days of the week when available funds are paid out, specified as an array, for example, [`monday`, `tuesday`]. Only shown if `interval` is weekly. + """ debit_negative_balances: bool """ @@ -1723,6 +1747,12 @@ class CreateParamsCapabilities(TypedDict): """ The cashapp_payments capability. """ + crypto_payments: NotRequired[ + "Account.CreateParamsCapabilitiesCryptoPayments" + ] + """ + The crypto_payments capability. + """ eps_payments: NotRequired[ "Account.CreateParamsCapabilitiesEpsPayments" ] @@ -2068,6 +2098,12 @@ class CreateParamsCapabilitiesCashappPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesCryptoPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesEpsPayments(TypedDict): requested: NotRequired[bool] """ @@ -2415,6 +2451,9 @@ class CreateParamsCompany(TypedDict): registration_date: NotRequired[ "Literal['']|Account.CreateParamsCompanyRegistrationDate" ] + """ + When the business was incorporated or registered. + """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). @@ -2663,6 +2702,12 @@ class CreateParamsDocuments(TypedDict): """ One or more documents that demonstrate proof of a company's tax ID. """ + proof_of_address: NotRequired[ + "Account.CreateParamsDocumentsProofOfAddress" + ] + """ + One or more documents that demonstrate proof of address. + """ proof_of_registration: NotRequired[ "Account.CreateParamsDocumentsProofOfRegistration" ] @@ -2712,6 +2757,12 @@ class CreateParamsDocumentsCompanyTaxIdVerification(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsDocumentsProofOfAddress(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class CreateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ @@ -3171,6 +3222,10 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ + monthly_payout_days: NotRequired[List[int]] + """ + The days of the month when available funds are paid out, specified as an array of numbers between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly` and `monthly_anchor` is not set. + """ weekly_anchor: NotRequired[ Literal[ "friday", @@ -3185,6 +3240,22 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ + weekly_payout_days: NotRequired[ + List[ + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] + ] + ] + """ + The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. (required and applicable only if `interval` is `weekly` and `weekly_anchor` is not set.) + """ class CreateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index aa66785b3..55c3b7daa 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -352,6 +352,12 @@ class CreateParamsCapabilities(TypedDict): """ The cashapp_payments capability. """ + crypto_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesCryptoPayments" + ] + """ + The crypto_payments capability. + """ eps_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesEpsPayments" ] @@ -701,6 +707,12 @@ class CreateParamsCapabilitiesCashappPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesCryptoPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesEpsPayments(TypedDict): requested: NotRequired[bool] """ @@ -1052,6 +1064,9 @@ class CreateParamsCompany(TypedDict): registration_date: NotRequired[ "Literal['']|AccountService.CreateParamsCompanyRegistrationDate" ] + """ + When the business was incorporated or registered. + """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). @@ -1302,6 +1317,12 @@ class CreateParamsDocuments(TypedDict): """ One or more documents that demonstrate proof of a company's tax ID. """ + proof_of_address: NotRequired[ + "AccountService.CreateParamsDocumentsProofOfAddress" + ] + """ + One or more documents that demonstrate proof of address. + """ proof_of_registration: NotRequired[ "AccountService.CreateParamsDocumentsProofOfRegistration" ] @@ -1351,6 +1372,12 @@ class CreateParamsDocumentsCompanyTaxIdVerification(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsDocumentsProofOfAddress(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class CreateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ @@ -1824,6 +1851,10 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ + monthly_payout_days: NotRequired[List[int]] + """ + The days of the month when available funds are paid out, specified as an array of numbers between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly` and `monthly_anchor` is not set. + """ weekly_anchor: NotRequired[ Literal[ "friday", @@ -1838,6 +1869,22 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ + weekly_payout_days: NotRequired[ + List[ + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] + ] + ] + """ + The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. (required and applicable only if `interval` is `weekly` and `weekly_anchor` is not set.) + """ class CreateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ @@ -2261,6 +2308,12 @@ class UpdateParamsCapabilities(TypedDict): """ The cashapp_payments capability. """ + crypto_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesCryptoPayments" + ] + """ + The crypto_payments capability. + """ eps_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesEpsPayments" ] @@ -2610,6 +2663,12 @@ class UpdateParamsCapabilitiesCashappPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesCryptoPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesEpsPayments(TypedDict): requested: NotRequired[bool] """ @@ -3173,6 +3232,12 @@ class UpdateParamsDocuments(TypedDict): """ One or more documents that demonstrate proof of a company's tax ID. """ + proof_of_address: NotRequired[ + "AccountService.UpdateParamsDocumentsProofOfAddress" + ] + """ + One or more documents that demonstrate proof of address. + """ proof_of_registration: NotRequired[ "AccountService.UpdateParamsDocumentsProofOfRegistration" ] @@ -3222,6 +3287,12 @@ class UpdateParamsDocumentsCompanyTaxIdVerification(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class UpdateParamsDocumentsProofOfAddress(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class UpdateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ @@ -3699,6 +3770,10 @@ class UpdateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ + monthly_payout_days: NotRequired[List[int]] + """ + The days of the month when available funds are paid out, specified as an array of numbers between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly` and `monthly_anchor` is not set. + """ weekly_anchor: NotRequired[ Literal[ "friday", @@ -3713,6 +3788,22 @@ class UpdateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ + weekly_payout_days: NotRequired[ + List[ + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] + ] + ] + """ + The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. (required and applicable only if `interval` is `weekly` and `weekly_anchor` is not set.) + """ class UpdateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index e23a8c044..c542ddaa9 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -25,11 +25,11 @@ class AccountManagement(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ enabled: bool @@ -43,11 +43,11 @@ class AccountOnboarding(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ enabled: bool @@ -61,23 +61,23 @@ class Balances(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: bool """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: bool """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: bool """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ enabled: bool @@ -95,15 +95,15 @@ class Features(StripeObject): """ destination_on_behalf_of_charge_management: bool """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ enabled: bool @@ -128,11 +128,11 @@ class FinancialAccount(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: bool """ - Whether to allow external accounts to be linked for money transfer. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ send_money: bool """ @@ -206,7 +206,7 @@ class Features(StripeObject): """ disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ spend_control_management: bool """ @@ -224,11 +224,11 @@ class NotificationBanner(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ enabled: bool @@ -246,15 +246,15 @@ class Features(StripeObject): """ destination_on_behalf_of_charge_management: bool """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ enabled: bool @@ -268,15 +268,15 @@ class PaymentDisputes(StripeObject): class Features(StripeObject): destination_on_behalf_of_charge_management: bool """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ enabled: bool @@ -294,15 +294,15 @@ class Features(StripeObject): """ destination_on_behalf_of_charge_management: bool """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ enabled: bool @@ -316,23 +316,23 @@ class Payouts(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: bool """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: bool """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: bool """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ enabled: bool @@ -431,97 +431,97 @@ class CreateParamsComponents(TypedDict): "AccountSession.CreateParamsComponentsAccountManagement" ] """ - Configuration for the account management embedded component. + Configuration for the [account management](https://docs.stripe.com/connect/supported-embedded-components/account-management/) embedded component. """ account_onboarding: NotRequired[ "AccountSession.CreateParamsComponentsAccountOnboarding" ] """ - Configuration for the account onboarding embedded component. + Configuration for the [account onboarding](https://docs.stripe.com/connect/supported-embedded-components/account-onboarding/) embedded component. """ balances: NotRequired["AccountSession.CreateParamsComponentsBalances"] """ - Configuration for the balances embedded component. + Configuration for the [balances](https://docs.stripe.com/connect/supported-embedded-components/balances/) embedded component. """ disputes_list: NotRequired[ "AccountSession.CreateParamsComponentsDisputesList" ] """ - Configuration for the disputes list embedded component. + Configuration for the [disputes list](https://docs.stripe.com/connect/supported-embedded-components/disputes-list/) embedded component. """ documents: NotRequired[ "AccountSession.CreateParamsComponentsDocuments" ] """ - Configuration for the documents embedded component. + Configuration for the [documents](https://docs.stripe.com/connect/supported-embedded-components/documents/) embedded component. """ financial_account: NotRequired[ "AccountSession.CreateParamsComponentsFinancialAccount" ] """ - Configuration for the financial account embedded component. + Configuration for the [financial account](https://docs.stripe.com/connect/supported-embedded-components/financial-account/) embedded component. """ financial_account_transactions: NotRequired[ "AccountSession.CreateParamsComponentsFinancialAccountTransactions" ] """ - Configuration for the financial account transactions embedded component. + Configuration for the [financial account transactions](https://docs.stripe.com/connect/supported-embedded-components/financial-account-transactions/) embedded component. """ issuing_card: NotRequired[ "AccountSession.CreateParamsComponentsIssuingCard" ] """ - Configuration for the issuing card embedded component. + Configuration for the [issuing card](https://docs.stripe.com/connect/supported-embedded-components/issuing-card/) embedded component. """ issuing_cards_list: NotRequired[ "AccountSession.CreateParamsComponentsIssuingCardsList" ] """ - Configuration for the issuing cards list embedded component. + Configuration for the [issuing cards list](https://docs.stripe.com/connect/supported-embedded-components/issuing-cards-list/) embedded component. """ notification_banner: NotRequired[ "AccountSession.CreateParamsComponentsNotificationBanner" ] """ - Configuration for the notification banner embedded component. + Configuration for the [notification banner](https://docs.stripe.com/connect/supported-embedded-components/notification-banner/) embedded component. """ payment_details: NotRequired[ "AccountSession.CreateParamsComponentsPaymentDetails" ] """ - Configuration for the payment details embedded component. + Configuration for the [payment details](https://docs.stripe.com/connect/supported-embedded-components/payment-details/) embedded component. """ payment_disputes: NotRequired[ "AccountSession.CreateParamsComponentsPaymentDisputes" ] """ - Configuration for the payment disputes embedded component. + Configuration for the [payment disputes](https://docs.stripe.com/connect/supported-embedded-components/payment-disputes/) embedded component. """ payments: NotRequired["AccountSession.CreateParamsComponentsPayments"] """ - Configuration for the payments embedded component. + Configuration for the [payments](https://docs.stripe.com/connect/supported-embedded-components/payments/) embedded component. """ payouts: NotRequired["AccountSession.CreateParamsComponentsPayouts"] """ - Configuration for the payouts embedded component. + Configuration for the [payouts](https://docs.stripe.com/connect/supported-embedded-components/payouts/) embedded component. """ payouts_list: NotRequired[ "AccountSession.CreateParamsComponentsPayoutsList" ] """ - Configuration for the payouts list embedded component. + Configuration for the [payouts list](https://docs.stripe.com/connect/supported-embedded-components/payouts-list/) embedded component. """ tax_registrations: NotRequired[ "AccountSession.CreateParamsComponentsTaxRegistrations" ] """ - Configuration for the tax registrations embedded component. + Configuration for the [tax registrations](https://docs.stripe.com/connect/supported-embedded-components/tax-registrations/) embedded component. """ tax_settings: NotRequired[ "AccountSession.CreateParamsComponentsTaxSettings" ] """ - Configuration for the tax settings embedded component. + Configuration for the [tax settings](https://docs.stripe.com/connect/supported-embedded-components/tax-settings/) embedded component. """ class CreateParamsComponentsAccountManagement(TypedDict): @@ -539,11 +539,11 @@ class CreateParamsComponentsAccountManagement(TypedDict): class CreateParamsComponentsAccountManagementFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsAccountOnboarding(TypedDict): @@ -561,11 +561,11 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsBalances(TypedDict): @@ -583,23 +583,23 @@ class CreateParamsComponentsBalances(TypedDict): class CreateParamsComponentsBalancesFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: NotRequired[bool] """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: NotRequired[bool] """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ class CreateParamsComponentsDisputesList(TypedDict): @@ -621,15 +621,15 @@ class CreateParamsComponentsDisputesListFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsDocuments(TypedDict): @@ -662,11 +662,11 @@ class CreateParamsComponentsFinancialAccount(TypedDict): class CreateParamsComponentsFinancialAccountFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow external accounts to be linked for money transfer. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ send_money: NotRequired[bool] """ @@ -754,7 +754,7 @@ class CreateParamsComponentsIssuingCardsListFeatures(TypedDict): """ disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ spend_control_management: NotRequired[bool] """ @@ -776,11 +776,11 @@ class CreateParamsComponentsNotificationBanner(TypedDict): class CreateParamsComponentsNotificationBannerFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsPaymentDetails(TypedDict): @@ -802,15 +802,15 @@ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPaymentDisputes(TypedDict): @@ -828,15 +828,15 @@ class CreateParamsComponentsPaymentDisputes(TypedDict): class CreateParamsComponentsPaymentDisputesFeatures(TypedDict): destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPayments(TypedDict): @@ -858,15 +858,15 @@ class CreateParamsComponentsPaymentsFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPayouts(TypedDict): @@ -884,23 +884,23 @@ class CreateParamsComponentsPayouts(TypedDict): class CreateParamsComponentsPayoutsFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: NotRequired[bool] """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: NotRequired[bool] """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ class CreateParamsComponentsPayoutsList(TypedDict): diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 5b88d2ff2..85d557c9b 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -27,103 +27,103 @@ class CreateParamsComponents(TypedDict): "AccountSessionService.CreateParamsComponentsAccountManagement" ] """ - Configuration for the account management embedded component. + Configuration for the [account management](https://docs.stripe.com/connect/supported-embedded-components/account-management/) embedded component. """ account_onboarding: NotRequired[ "AccountSessionService.CreateParamsComponentsAccountOnboarding" ] """ - Configuration for the account onboarding embedded component. + Configuration for the [account onboarding](https://docs.stripe.com/connect/supported-embedded-components/account-onboarding/) embedded component. """ balances: NotRequired[ "AccountSessionService.CreateParamsComponentsBalances" ] """ - Configuration for the balances embedded component. + Configuration for the [balances](https://docs.stripe.com/connect/supported-embedded-components/balances/) embedded component. """ disputes_list: NotRequired[ "AccountSessionService.CreateParamsComponentsDisputesList" ] """ - Configuration for the disputes list embedded component. + Configuration for the [disputes list](https://docs.stripe.com/connect/supported-embedded-components/disputes-list/) embedded component. """ documents: NotRequired[ "AccountSessionService.CreateParamsComponentsDocuments" ] """ - Configuration for the documents embedded component. + Configuration for the [documents](https://docs.stripe.com/connect/supported-embedded-components/documents/) embedded component. """ financial_account: NotRequired[ "AccountSessionService.CreateParamsComponentsFinancialAccount" ] """ - Configuration for the financial account embedded component. + Configuration for the [financial account](https://docs.stripe.com/connect/supported-embedded-components/financial-account/) embedded component. """ financial_account_transactions: NotRequired[ "AccountSessionService.CreateParamsComponentsFinancialAccountTransactions" ] """ - Configuration for the financial account transactions embedded component. + Configuration for the [financial account transactions](https://docs.stripe.com/connect/supported-embedded-components/financial-account-transactions/) embedded component. """ issuing_card: NotRequired[ "AccountSessionService.CreateParamsComponentsIssuingCard" ] """ - Configuration for the issuing card embedded component. + Configuration for the [issuing card](https://docs.stripe.com/connect/supported-embedded-components/issuing-card/) embedded component. """ issuing_cards_list: NotRequired[ "AccountSessionService.CreateParamsComponentsIssuingCardsList" ] """ - Configuration for the issuing cards list embedded component. + Configuration for the [issuing cards list](https://docs.stripe.com/connect/supported-embedded-components/issuing-cards-list/) embedded component. """ notification_banner: NotRequired[ "AccountSessionService.CreateParamsComponentsNotificationBanner" ] """ - Configuration for the notification banner embedded component. + Configuration for the [notification banner](https://docs.stripe.com/connect/supported-embedded-components/notification-banner/) embedded component. """ payment_details: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentDetails" ] """ - Configuration for the payment details embedded component. + Configuration for the [payment details](https://docs.stripe.com/connect/supported-embedded-components/payment-details/) embedded component. """ payment_disputes: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentDisputes" ] """ - Configuration for the payment disputes embedded component. + Configuration for the [payment disputes](https://docs.stripe.com/connect/supported-embedded-components/payment-disputes/) embedded component. """ payments: NotRequired[ "AccountSessionService.CreateParamsComponentsPayments" ] """ - Configuration for the payments embedded component. + Configuration for the [payments](https://docs.stripe.com/connect/supported-embedded-components/payments/) embedded component. """ payouts: NotRequired[ "AccountSessionService.CreateParamsComponentsPayouts" ] """ - Configuration for the payouts embedded component. + Configuration for the [payouts](https://docs.stripe.com/connect/supported-embedded-components/payouts/) embedded component. """ payouts_list: NotRequired[ "AccountSessionService.CreateParamsComponentsPayoutsList" ] """ - Configuration for the payouts list embedded component. + Configuration for the [payouts list](https://docs.stripe.com/connect/supported-embedded-components/payouts-list/) embedded component. """ tax_registrations: NotRequired[ "AccountSessionService.CreateParamsComponentsTaxRegistrations" ] """ - Configuration for the tax registrations embedded component. + Configuration for the [tax registrations](https://docs.stripe.com/connect/supported-embedded-components/tax-registrations/) embedded component. """ tax_settings: NotRequired[ "AccountSessionService.CreateParamsComponentsTaxSettings" ] """ - Configuration for the tax settings embedded component. + Configuration for the [tax settings](https://docs.stripe.com/connect/supported-embedded-components/tax-settings/) embedded component. """ class CreateParamsComponentsAccountManagement(TypedDict): @@ -141,11 +141,11 @@ class CreateParamsComponentsAccountManagement(TypedDict): class CreateParamsComponentsAccountManagementFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsAccountOnboarding(TypedDict): @@ -163,11 +163,11 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsBalances(TypedDict): @@ -185,23 +185,23 @@ class CreateParamsComponentsBalances(TypedDict): class CreateParamsComponentsBalancesFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: NotRequired[bool] """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: NotRequired[bool] """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ class CreateParamsComponentsDisputesList(TypedDict): @@ -223,15 +223,15 @@ class CreateParamsComponentsDisputesListFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsDocuments(TypedDict): @@ -264,11 +264,11 @@ class CreateParamsComponentsFinancialAccount(TypedDict): class CreateParamsComponentsFinancialAccountFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow external accounts to be linked for money transfer. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ send_money: NotRequired[bool] """ @@ -356,7 +356,7 @@ class CreateParamsComponentsIssuingCardsListFeatures(TypedDict): """ disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ spend_control_management: NotRequired[bool] """ @@ -378,11 +378,11 @@ class CreateParamsComponentsNotificationBanner(TypedDict): class CreateParamsComponentsNotificationBannerFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsPaymentDetails(TypedDict): @@ -404,15 +404,15 @@ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPaymentDisputes(TypedDict): @@ -430,15 +430,15 @@ class CreateParamsComponentsPaymentDisputes(TypedDict): class CreateParamsComponentsPaymentDisputesFeatures(TypedDict): destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPayments(TypedDict): @@ -460,15 +460,15 @@ class CreateParamsComponentsPaymentsFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPayouts(TypedDict): @@ -486,23 +486,23 @@ class CreateParamsComponentsPayouts(TypedDict): class CreateParamsComponentsPayoutsFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: NotRequired[bool] """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: NotRequired[bool] """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ class CreateParamsComponentsPayoutsList(TypedDict): diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 442d12055..6f3730c3b 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2025-05-28.basil" + CURRENT = "2025-06-30.basil" CURRENT_MAJOR = "basil" diff --git a/stripe/_charge.py b/stripe/_charge.py index a72febb79..ad26d58d9 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -473,9 +473,9 @@ class Plan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ plan: Optional[Plan] @@ -819,7 +819,7 @@ class ShippingAddress(StripeObject): incremental_authorization: Optional[IncrementalAuthorization] installments: Optional[Installments] """ - Installment details for this payment (Mexico only). + Installment details for this payment. For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ @@ -897,11 +897,11 @@ class Receipt(StripeObject): """ application_cryptogram: Optional[str] """ - EMV tag 9F26, cryptogram generated by the integrated circuit chip. + The Application Cryptogram, a unique value generated by the card to authenticate the transaction with issuers. """ application_preferred_name: Optional[str] """ - Mnenomic of the Application Identifier. + The Application Identifier (AID) on the card used to determine which networks are eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the card's chip. """ authorization_code: Optional[str] """ @@ -917,15 +917,15 @@ class Receipt(StripeObject): """ dedicated_file_name: Optional[str] """ - EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + Similar to the application_preferred_name, identifying the applications (AIDs) available on the card. Referenced from EMV tag 84. """ terminal_verification_results: Optional[str] """ - The outcome of a series of EMV functions performed by the card reader. + A 5-byte string that records the checks and validations that occur between the card and the terminal. These checks determine how the terminal processes the transaction and what risk tolerance is acceptable. Referenced from EMV Tag 95. """ transaction_status_information: Optional[str] """ - An indication of various EMV functions performed during the transaction. + An indication of which steps were completed during the card read process. Referenced from EMV Tag 9B. """ class Wallet(StripeObject): @@ -1024,7 +1024,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -1059,6 +1059,24 @@ class Cashapp(StripeObject): A public identifier for buyers using Cash App. """ + class Crypto(StripeObject): + buyer_address: Optional[str] + """ + The wallet address of the customer. + """ + network: Optional[Literal["base", "ethereum", "polygon"]] + """ + The blockchain network that the transaction was sent on. + """ + token_currency: Optional[Literal["usdc", "usdg", "usdp"]] + """ + The token currency that the transaction was sent with. + """ + transaction_hash: Optional[str] + """ + The blockchain transaction hash of the crypto payment. + """ + class CustomerBalance(StripeObject): pass @@ -1174,6 +1192,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -1190,7 +1209,7 @@ class Ideal(StripeObject): ] ] """ - The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ @@ -1198,6 +1217,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -1244,11 +1264,11 @@ class Receipt(StripeObject): """ application_cryptogram: Optional[str] """ - EMV tag 9F26, cryptogram generated by the integrated circuit chip. + The Application Cryptogram, a unique value generated by the card to authenticate the transaction with issuers. """ application_preferred_name: Optional[str] """ - Mnenomic of the Application Identifier. + The Application Identifier (AID) on the card used to determine which networks are eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the card's chip. """ authorization_code: Optional[str] """ @@ -1264,15 +1284,15 @@ class Receipt(StripeObject): """ dedicated_file_name: Optional[str] """ - EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + Similar to the application_preferred_name, identifying the applications (AIDs) available on the card. Referenced from EMV tag 84. """ terminal_verification_results: Optional[str] """ - The outcome of a series of EMV functions performed by the card reader. + A 5-byte string that records the checks and validations that occur between the card and the terminal. These checks determine how the terminal processes the transaction and what risk tolerance is acceptable. Referenced from EMV Tag 95. """ transaction_status_information: Optional[str] """ - An indication of various EMV functions performed during the transaction. + An indication of which steps were completed during the card read process. Referenced from EMV Tag 9B. """ brand: Optional[str] @@ -1339,7 +1359,7 @@ class Receipt(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -1872,6 +1892,7 @@ class Zip(StripeObject): card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + crypto: Optional[Crypto] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] @@ -1933,6 +1954,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 1ebd0757e..82f2b890c 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -75,9 +75,9 @@ class Plan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ plan: Optional[Plan] @@ -268,11 +268,11 @@ class Receipt(StripeObject): """ application_cryptogram: Optional[str] """ - EMV tag 9F26, cryptogram generated by the integrated circuit chip. + The Application Cryptogram, a unique value generated by the card to authenticate the transaction with issuers. """ application_preferred_name: Optional[str] """ - Mnenomic of the Application Identifier. + The Application Identifier (AID) on the card used to determine which networks are eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the card's chip. """ authorization_code: Optional[str] """ @@ -288,15 +288,15 @@ class Receipt(StripeObject): """ dedicated_file_name: Optional[str] """ - EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + Similar to the application_preferred_name, identifying the applications (AIDs) available on the card. Referenced from EMV tag 84. """ terminal_verification_results: Optional[str] """ - The outcome of a series of EMV functions performed by the card reader. + A 5-byte string that records the checks and validations that occur between the card and the terminal. These checks determine how the terminal processes the transaction and what risk tolerance is acceptable. Referenced from EMV Tag 95. """ transaction_status_information: Optional[str] """ - An indication of various EMV functions performed during the transaction. + An indication of which steps were completed during the card read process. Referenced from EMV Tag 9B. """ class Wallet(StripeObject): @@ -398,7 +398,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -826,7 +826,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -857,6 +857,9 @@ class Cashapp(StripeObject): A public identifier for buyers using Cash App. """ + class Crypto(StripeObject): + pass + class CustomerBalance(StripeObject): pass @@ -942,6 +945,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -958,7 +962,7 @@ class Ideal(StripeObject): ] ] """ - The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ @@ -966,6 +970,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -1048,7 +1053,7 @@ class Networks(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -1420,6 +1425,7 @@ class Zip(StripeObject): card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + crypto: Optional[Crypto] customer: Optional[ExpandableField["Customer"]] """ The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. @@ -1471,6 +1477,7 @@ class Zip(StripeObject): "card", "card_present", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1529,6 +1536,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, @@ -1730,6 +1738,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -1932,6 +1946,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2103,6 +2118,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -2188,6 +2206,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2429,9 +2448,9 @@ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsShipping(TypedDict): diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 53963985f..2b7f91338 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -197,7 +197,7 @@ class TaxRateDetails(StripeObject): class CreateParams(RequestOptions): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -221,7 +221,7 @@ class CreateParams(RequestOptions): """ lines: NotRequired[List["CreditNote.CreateParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -256,7 +256,7 @@ class CreateParams(RequestOptions): """ shipping_cost: NotRequired["CreditNote.CreateParamsShippingCost"] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ class CreateParamsLine(TypedDict): @@ -412,7 +412,7 @@ class ModifyParams(RequestOptions): class PreviewLinesParams(RequestOptions): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -444,7 +444,7 @@ class PreviewLinesParams(RequestOptions): """ lines: NotRequired[List["CreditNote.PreviewLinesParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -479,7 +479,7 @@ class PreviewLinesParams(RequestOptions): """ shipping_cost: NotRequired["CreditNote.PreviewLinesParamsShippingCost"] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ starting_after: NotRequired[str] """ @@ -559,7 +559,7 @@ class PreviewLinesParamsShippingCost(TypedDict): class PreviewParams(RequestOptions): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -583,7 +583,7 @@ class PreviewParams(RequestOptions): """ lines: NotRequired[List["CreditNote.PreviewParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -618,7 +618,7 @@ class PreviewParams(RequestOptions): """ shipping_cost: NotRequired["CreditNote.PreviewParamsShippingCost"] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ class PreviewParamsLine(TypedDict): diff --git a/stripe/_credit_note_preview_lines_service.py b/stripe/_credit_note_preview_lines_service.py index 4923a5d63..e897ed45f 100644 --- a/stripe/_credit_note_preview_lines_service.py +++ b/stripe/_credit_note_preview_lines_service.py @@ -12,7 +12,7 @@ class CreditNotePreviewLinesService(StripeService): class ListParams(TypedDict): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -46,7 +46,7 @@ class ListParams(TypedDict): List["CreditNotePreviewLinesService.ListParamsLine"] ] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -85,7 +85,7 @@ class ListParams(TypedDict): "CreditNotePreviewLinesService.ListParamsShippingCost" ] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ starting_after: NotRequired[str] """ diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index 5f3a56223..2fb3f7bd9 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -22,7 +22,7 @@ def __init__(self, requestor): class CreateParams(TypedDict): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -46,7 +46,7 @@ class CreateParams(TypedDict): """ lines: NotRequired[List["CreditNoteService.CreateParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -83,7 +83,7 @@ class CreateParams(TypedDict): "CreditNoteService.CreateParamsShippingCost" ] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ class CreateParamsLine(TypedDict): @@ -207,7 +207,7 @@ class ListParamsCreated(TypedDict): class PreviewParams(TypedDict): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -231,7 +231,7 @@ class PreviewParams(TypedDict): """ lines: NotRequired[List["CreditNoteService.PreviewParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -268,7 +268,7 @@ class PreviewParams(TypedDict): "CreditNoteService.PreviewParamsShippingCost" ] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ class PreviewParamsLine(TypedDict): diff --git a/stripe/_customer.py b/stripe/_customer.py index 1b422fdd6..820b5e28f 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -922,6 +922,7 @@ class ListPaymentMethodsParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index ce2321821..7ad7890f2 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -49,6 +49,7 @@ class ListParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index a47dfd486..04c201cd6 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -52,7 +52,7 @@ class Features(StripeObject): """ payment_method_redisplay_limit: Optional[int] """ - Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`. """ payment_method_remove: Literal["disabled", "enabled"] """ @@ -176,7 +176,7 @@ class CreateParamsComponentsPaymentElementFeatures(TypedDict): """ payment_method_redisplay_limit: NotRequired[int] """ - Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`. """ payment_method_remove: NotRequired[Literal["disabled", "enabled"]] """ diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index 820ab18a4..c7f6f5424 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -75,7 +75,7 @@ class CreateParamsComponentsPaymentElementFeatures(TypedDict): """ payment_method_redisplay_limit: NotRequired[int] """ - Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`. """ payment_method_remove: NotRequired[Literal["disabled", "enabled"]] """ diff --git a/stripe/_dispute.py b/stripe/_dispute.py index cf5c46f5c..2584022a1 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -368,7 +368,7 @@ class Card(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ - case_type: Literal["chargeback", "inquiry"] + case_type: Literal["chargeback", "compliance", "inquiry"] """ The type of dispute opened. Different case types may have varying fees and financial impact. """ @@ -794,7 +794,9 @@ class RetrieveParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - enhanced_eligibility_types: List[Literal["visa_compelling_evidence_3"]] + enhanced_eligibility_types: List[ + Literal["visa_compelling_evidence_3", "visa_compliance"] + ] """ List of eligibility types that are included in `enhanced_evidence`. """ diff --git a/stripe/_event.py b/stripe/_event.py index 18fa1e2e3..cd4748f4e 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -128,7 +128,7 @@ class RetrieveParams(RequestOptions): """ api_version: Optional[str] """ - The Stripe API version used to render `data`. This property is populated only for events on or after October 31, 2014. + The Stripe API version used to render `data` when the event was created. The contents of `data` never change, so this value remains static regardless of the API version currently in use. This property is populated only for events created on or after October 31, 2014. """ context: Optional[str] """ @@ -358,6 +358,7 @@ class RetrieveParams(RequestOptions): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index c4a607841..43c483457 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -866,6 +866,7 @@ class Filters(StripeObject): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1620,7 +1621,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1741,9 +1742,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( @@ -2495,6 +2496,12 @@ class CreatePreviewParamsIssuer(TypedDict): """ class CreatePreviewParamsScheduleDetails(TypedDict): + billing_mode: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ 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. @@ -2512,6 +2519,9 @@ class CreatePreviewParamsScheduleDetails(TypedDict): 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 CreatePreviewParamsScheduleDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ @@ -2883,13 +2893,19 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ + billing_mode: NotRequired[ + "Invoice.CreatePreviewParamsSubscriptionDetailsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ 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] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ @@ -2928,6 +2944,9 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ + class CreatePreviewParamsSubscriptionDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" @@ -3346,7 +3365,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -3467,9 +3486,9 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 302bedb3b..17e27894a 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -33,10 +33,7 @@ class InvoiceItem( UpdateableAPIResource["InvoiceItem"], ): """ - Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). An invoice item is added to an - invoice by creating or updating it with an `invoice` field, at which point it will be included as - [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within - [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines). + Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). When you create an invoice item with an `invoice` field, it is attached to the specified invoice and included as [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines). Invoice Items can be created before you are ready to actually send the invoice. This can be particularly useful when combined with a [subscription](https://stripe.com/docs/api/subscriptions). Sometimes you want to add a charge or credit to a customer, but actually charge diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 17e2fa1cd..3763484e5 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -493,7 +493,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -614,9 +614,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( @@ -1376,6 +1376,12 @@ class CreatePreviewParamsIssuer(TypedDict): """ class CreatePreviewParamsScheduleDetails(TypedDict): + billing_mode: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ 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. @@ -1393,6 +1399,9 @@ class CreatePreviewParamsScheduleDetails(TypedDict): 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 CreatePreviewParamsScheduleDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ @@ -1766,13 +1775,19 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ + billing_mode: NotRequired[ + "InvoiceService.CreatePreviewParamsSubscriptionDetailsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ 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] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ @@ -1811,6 +1826,9 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ + class CreatePreviewParamsSubscriptionDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceService.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" @@ -2552,7 +2570,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -2673,9 +2691,9 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( diff --git a/stripe/_mandate.py b/stripe/_mandate.py index 0260a4fd0..147923dd3 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -112,6 +112,9 @@ class Cashapp(StripeObject): class KakaoPay(StripeObject): pass + class Klarna(StripeObject): + pass + class KrCard(StripeObject): pass @@ -160,6 +163,7 @@ class UsBankAccount(StripeObject): card: Optional[Card] cashapp: Optional[Cashapp] kakao_pay: Optional[KakaoPay] + klarna: Optional[Klarna] kr_card: Optional[KrCard] link: Optional[Link] naver_pay: Optional[NaverPay] @@ -180,6 +184,7 @@ class UsBankAccount(StripeObject): "card": Card, "cashapp": Cashapp, "kakao_pay": KakaoPay, + "klarna": Klarna, "kr_card": KrCard, "link": Link, "naver_pay": NaverPay, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 175b190c7..0a55a5eda 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1572,9 +1572,9 @@ class AvailablePlan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class Plan(StripeObject): @@ -1587,9 +1587,9 @@ class Plan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ available_plans: Optional[List[AvailablePlan]] @@ -1653,7 +1653,7 @@ class MandateOptions(StripeObject): """ installments: Optional[Installments] """ - Installment details for this payment (Mexico only). + Installment details for this payment. For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ @@ -1774,6 +1774,18 @@ class Cashapp(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + class Crypto(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + class CustomerBalance(StripeObject): class BankTransfer(StripeObject): class EuBankTransfer(StripeObject): @@ -1920,7 +1932,9 @@ class Klarna(StripeObject): """ Preferred locale of the Klarna checkout page that the customer is redirected to. """ - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2386,6 +2400,7 @@ class Zip(StripeObject): card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + crypto: Optional[Crypto] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] @@ -2436,6 +2451,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, @@ -2692,7 +2708,7 @@ class ConfirmParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ radar_options: NotRequired["PaymentIntent.ConfirmParamsRadarOptions"] """ @@ -2863,6 +2879,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataCustomerBalance" ] @@ -3053,6 +3075,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3224,6 +3247,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -3309,6 +3335,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -3608,6 +3635,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalance" ] @@ -4226,9 +4259,9 @@ class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -4395,6 +4428,20 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -4571,6 +4618,12 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + on_demand: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -4624,7 +4677,9 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4636,6 +4691,70 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] @@ -5381,7 +5500,7 @@ class CreateParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ radar_options: NotRequired["PaymentIntent.CreateParamsRadarOptions"] """ @@ -5575,6 +5694,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -5765,6 +5890,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -5936,6 +6062,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -6021,6 +6150,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -6320,6 +6450,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalance" ] @@ -6938,9 +7074,9 @@ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -7107,6 +7243,20 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -7283,6 +7433,12 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + on_demand: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -7336,7 +7492,9 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7348,6 +7506,70 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntent.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class CreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] @@ -8149,7 +8371,7 @@ class ModifyParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ receipt_email: NotRequired["Literal['']|str"] """ @@ -8279,6 +8501,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataCustomerBalance" ] @@ -8469,6 +8697,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -8640,6 +8869,9 @@ class ModifyParamsPaymentMethodDataBoleto(TypedDict): class ModifyParamsPaymentMethodDataCashapp(TypedDict): pass + class ModifyParamsPaymentMethodDataCrypto(TypedDict): + pass + class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -8725,6 +8957,7 @@ class ModifyParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -9024,6 +9257,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCustomerBalance" ] @@ -9642,9 +9881,9 @@ class ModifyParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -9811,6 +10050,20 @@ class ModifyParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -9987,6 +10240,12 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + on_demand: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -10040,7 +10299,9 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -10052,6 +10313,70 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntent.ModifyParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class ModifyParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ModifyParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ModifyParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 5cd968d97..c6329d987 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -141,7 +141,7 @@ class ConfirmParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ radar_options: NotRequired[ "PaymentIntentService.ConfirmParamsRadarOptions" @@ -318,6 +318,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataCustomerBalance" ] @@ -528,6 +534,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -701,6 +708,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -786,6 +796,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -1085,6 +1096,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalance" ] @@ -1703,9 +1720,9 @@ class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -1872,6 +1889,20 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -2048,6 +2079,12 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + on_demand: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -2101,7 +2138,9 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2113,6 +2152,70 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] @@ -2858,7 +2961,7 @@ class CreateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ radar_options: NotRequired[ "PaymentIntentService.CreateParamsRadarOptions" @@ -3060,6 +3163,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -3270,6 +3379,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3443,6 +3553,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -3528,6 +3641,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -3827,6 +3941,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalance" ] @@ -4445,9 +4565,9 @@ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -4614,6 +4734,20 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -4790,6 +4924,12 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + on_demand: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -4843,7 +4983,9 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4855,6 +4997,70 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntentService.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class CreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] @@ -5684,7 +5890,7 @@ class UpdateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ receipt_email: NotRequired["Literal['']|str"] """ @@ -5822,6 +6028,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataCustomerBalance" ] @@ -6032,6 +6244,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -6205,6 +6418,9 @@ class UpdateParamsPaymentMethodDataBoleto(TypedDict): class UpdateParamsPaymentMethodDataCashapp(TypedDict): pass + class UpdateParamsPaymentMethodDataCrypto(TypedDict): + pass + class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -6290,6 +6506,7 @@ class UpdateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -6589,6 +6806,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCustomerBalance" ] @@ -7207,9 +7430,9 @@ class UpdateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -7376,6 +7599,20 @@ class UpdateParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -7552,6 +7789,12 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + on_demand: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -7605,7 +7848,9 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7617,6 +7862,70 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntentService.UpdateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class UpdateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class UpdateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class UpdateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 5e02947ae..8064bf039 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -204,11 +204,11 @@ class Receipt(StripeObject): """ application_cryptogram: Optional[str] """ - EMV tag 9F26, cryptogram generated by the integrated circuit chip. + The Application Cryptogram, a unique value generated by the card to authenticate the transaction with issuers. """ application_preferred_name: Optional[str] """ - Mnenomic of the Application Identifier. + The Application Identifier (AID) on the card used to determine which networks are eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the card's chip. """ authorization_code: Optional[str] """ @@ -224,15 +224,15 @@ class Receipt(StripeObject): """ dedicated_file_name: Optional[str] """ - EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + Similar to the application_preferred_name, identifying the applications (AIDs) available on the card. Referenced from EMV tag 84. """ terminal_verification_results: Optional[str] """ - The outcome of a series of EMV functions performed by the card reader. + A 5-byte string that records the checks and validations that occur between the card and the terminal. These checks determine how the terminal processes the transaction and what risk tolerance is acceptable. Referenced from EMV Tag 95. """ transaction_status_information: Optional[str] """ - An indication of various EMV functions performed during the transaction. + An indication of which steps were completed during the card read process. Referenced from EMV Tag 9B. """ class Wallet(StripeObject): @@ -331,7 +331,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -757,7 +757,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -788,6 +788,9 @@ class Cashapp(StripeObject): A public identifier for buyers using Cash App. """ + class Crypto(StripeObject): + pass + class CustomerBalance(StripeObject): pass @@ -873,6 +876,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -889,7 +893,7 @@ class Ideal(StripeObject): ] ] """ - The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ @@ -897,6 +901,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -979,7 +984,7 @@ class Networks(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -1418,6 +1423,10 @@ class CreateParams(RequestOptions): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["PaymentMethod.CreateParamsCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer: NotRequired[str] """ The `Customer` to whom the original PaymentMethod is attached. @@ -1582,6 +1591,7 @@ class CreateParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1784,6 +1794,9 @@ class CreateParamsCardNetworks(TypedDict): class CreateParamsCashapp(TypedDict): pass + class CreateParamsCrypto(TypedDict): + pass + class CreateParamsCustomerBalance(TypedDict): pass @@ -1869,6 +1882,7 @@ class CreateParamsIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2118,6 +2132,7 @@ class ListParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2313,6 +2328,7 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + crypto: Optional[Crypto] customer: Optional[ExpandableField["Customer"]] """ The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. @@ -2384,6 +2400,7 @@ class RetrieveParams(RequestOptions): "card", "card_present", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2899,6 +2916,7 @@ async def retrieve_async( "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index aec38a34e..313a0d9fd 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -93,6 +93,10 @@ class CreateParams(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["PaymentMethodService.CreateParamsCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer: NotRequired[str] """ The `Customer` to whom the original PaymentMethod is attached. @@ -261,6 +265,7 @@ class CreateParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -465,6 +470,9 @@ class CreateParamsCardNetworks(TypedDict): class CreateParamsCashapp(TypedDict): pass + class CreateParamsCrypto(TypedDict): + pass + class CreateParamsCustomerBalance(TypedDict): pass @@ -550,6 +558,7 @@ class CreateParamsIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -799,6 +808,7 @@ class ListParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", diff --git a/stripe/_quote.py b/stripe/_quote.py index fd2a8baa1..075384c54 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -316,6 +316,16 @@ class StatusTransitions(StripeObject): """ class SubscriptionData(StripeObject): + class BillingMode(StripeObject): + type: Literal["classic", "flexible"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + + billing_mode: BillingMode + """ + The billing mode of the quote. + """ 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. @@ -332,6 +342,7 @@ class SubscriptionData(StripeObject): """ Integer representing the number of trial period days before the customer is charged for the first time. """ + _inner_class_types = {"billing_mode": BillingMode} class TotalDetails(StripeObject): class Breakdown(StripeObject): @@ -664,6 +675,12 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): """ class CreateParamsSubscriptionData(TypedDict): + billing_mode: NotRequired[ + "Quote.CreateParamsSubscriptionDataBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ 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. @@ -672,7 +689,7 @@ class CreateParamsSubscriptionData(TypedDict): "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. + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ @@ -683,6 +700,9 @@ class CreateParamsSubscriptionData(TypedDict): Integer representing the number of trial period days before the customer is charged for the first time. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ @@ -994,7 +1014,7 @@ class ModifyParamsSubscriptionData(TypedDict): "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. + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 018d88d69..7b5a9dde6 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -272,6 +272,12 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): """ class CreateParamsSubscriptionData(TypedDict): + billing_mode: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ 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. @@ -280,7 +286,7 @@ class CreateParamsSubscriptionData(TypedDict): "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. + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ @@ -291,6 +297,9 @@ class CreateParamsSubscriptionData(TypedDict): Integer representing the number of trial period days before the customer is charged for the first time. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ @@ -588,7 +597,7 @@ class UpdateParamsSubscriptionData(TypedDict): "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. + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index e80374a63..acc072dff 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -269,6 +269,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -285,7 +286,7 @@ class Ideal(StripeObject): ] ] """ - The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ @@ -293,6 +294,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 080caf3ba..f5414cc16 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -566,6 +566,16 @@ class MandateOptions(StripeObject): class CardPresent(StripeObject): pass + class Klarna(StripeObject): + currency: Optional[str] + """ + The currency of the setup intent. Three letter ISO currency code. + """ + preferred_locale: Optional[str] + """ + Preferred locale of the Klarna checkout page that the customer is redirected to. + """ + class Link(StripeObject): persistent_token: Optional[str] """ @@ -648,6 +658,7 @@ class MandateOptions(StripeObject): bacs_debit: Optional[BacsDebit] card: Optional[Card] card_present: Optional[CardPresent] + klarna: Optional[Klarna] link: Optional[Link] paypal: Optional[Paypal] sepa_debit: Optional[SepaDebit] @@ -658,6 +669,7 @@ class MandateOptions(StripeObject): "bacs_debit": BacsDebit, "card": Card, "card_present": CardPresent, + "klarna": Klarna, "link": Link, "paypal": Paypal, "sepa_debit": SepaDebit, @@ -840,6 +852,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataCustomerBalance" ] @@ -1022,6 +1038,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1193,6 +1210,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -1278,6 +1298,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -1513,6 +1534,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired["SetupIntent.ConfirmParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. @@ -1765,6 +1792,133 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca message extension: CB-SCORE; numeric value 0-99 """ + class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntent.ConfirmParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntent.ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class ConfirmParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -1951,7 +2105,7 @@ class CreateParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ return_url: NotRequired[str] """ @@ -2106,6 +2260,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["SetupIntent.CreateParamsPaymentMethodDataCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -2286,6 +2444,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2457,6 +2616,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -2542,6 +2704,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2777,6 +2940,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired["SetupIntent.CreateParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. @@ -3029,6 +3198,133 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai message extension: CB-SCORE; numeric value 0-99 """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntent.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class CreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntent.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -3253,7 +3549,7 @@ class ModifyParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ class ModifyParamsPaymentMethodData(TypedDict): @@ -3335,6 +3631,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataCustomerBalance" ] @@ -3515,6 +3815,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3686,6 +3987,9 @@ class ModifyParamsPaymentMethodDataBoleto(TypedDict): class ModifyParamsPaymentMethodDataCashapp(TypedDict): pass + class ModifyParamsPaymentMethodDataCrypto(TypedDict): + pass + class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -3771,6 +4075,7 @@ class ModifyParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -4006,6 +4311,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired["SetupIntent.ModifyParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. @@ -4258,6 +4569,133 @@ class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai message extension: CB-SCORE; numeric value 0-99 """ + class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntent.ModifyParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class ModifyParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ModifyParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntent.ModifyParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ModifyParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class ModifyParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -4486,7 +4924,7 @@ class VerifyMicrodepositsParams(RequestOptions): """ payment_method_types: List[str] """ - The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ single_use_mandate: Optional[ExpandableField["Mandate"]] """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 19b5f052c..016555884 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -198,6 +198,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataCustomerBalance" ] @@ -408,6 +414,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -581,6 +588,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -666,6 +676,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -905,6 +916,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsLink" ] @@ -1159,6 +1176,133 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca message extension: CB-SCORE; numeric value 0-99 """ + class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntentService.ConfirmParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntentService.ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class ConfirmParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -1345,7 +1489,7 @@ class CreateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ return_url: NotRequired[str] """ @@ -1512,6 +1656,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -1714,6 +1864,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1885,6 +2036,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -1970,6 +2124,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2209,6 +2364,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsLink" ] @@ -2463,6 +2624,133 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai message extension: CB-SCORE; numeric value 0-99 """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntentService.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class CreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntentService.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -2697,7 +2985,7 @@ class UpdateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ class UpdateParamsPaymentMethodData(TypedDict): @@ -2791,6 +3079,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataCustomerBalance" ] @@ -2993,6 +3287,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3164,6 +3459,9 @@ class UpdateParamsPaymentMethodDataBoleto(TypedDict): class UpdateParamsPaymentMethodDataCashapp(TypedDict): pass + class UpdateParamsPaymentMethodDataCrypto(TypedDict): + pass + class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -3249,6 +3547,7 @@ class UpdateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -3488,6 +3787,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsLink" ] @@ -3742,6 +4047,133 @@ class UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai message extension: CB-SCORE; numeric value 0-99 """ + class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntentService.UpdateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class UpdateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class UpdateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntentService.UpdateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class UpdateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class UpdateParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 65600714c..44605b5ba 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -110,6 +110,16 @@ class BillingCycleAnchorConfig(StripeObject): The second of the minute of the billing_cycle_anchor. """ + class BillingMode(StripeObject): + type: Literal["classic", "flexible"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + updated_at: Optional[int] + """ + Details on when the current billing_mode was adopted. + """ + class BillingThresholds(StripeObject): amount_gte: Optional[int] """ @@ -372,6 +382,7 @@ class Filters(StripeObject): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -515,11 +526,11 @@ class CreateParams(RequestOptions): """ automatic_tax: NotRequired["Subscription.CreateParamsAutomaticTax"] """ - Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. + Automatic tax settings for this subscription. """ backdate_start_date: NotRequired[int] """ - For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. """ billing_cycle_anchor: NotRequired[int] """ @@ -531,6 +542,10 @@ class CreateParams(RequestOptions): """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ + billing_mode: NotRequired["Subscription.CreateParamsBillingMode"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ billing_thresholds: NotRequired[ "Literal['']|Subscription.CreateParamsBillingThresholds" ] @@ -543,7 +558,7 @@ class CreateParams(RequestOptions): """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] @@ -779,6 +794,9 @@ class CreateParamsBillingCycleAnchorConfig(TypedDict): The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ + class CreateParamsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ @@ -927,7 +945,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1327,6 +1345,19 @@ class ListParamsCurrentPeriodStart(TypedDict): Maximum value to filter by (inclusive) """ + class MigrateParams(RequestOptions): + billing_mode: "Subscription.MigrateParamsBillingMode" + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class MigrateParamsBillingMode(TypedDict): + type: Literal["flexible"] + class ModifyParams(RequestOptions): add_invoice_items: NotRequired[ List["Subscription.ModifyParamsAddInvoiceItem"] @@ -1358,7 +1389,7 @@ class ModifyParams(RequestOptions): """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancellation_details: NotRequired[ "Subscription.ModifyParamsCancellationDetails" @@ -1756,7 +1787,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -2077,6 +2108,10 @@ class SearchParams(RequestOptions): """ The fixed values used to calculate the `billing_cycle_anchor`. """ + billing_mode: BillingMode + """ + The billing mode of the subscription. + """ billing_thresholds: Optional[BillingThresholds] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period @@ -2087,7 +2122,7 @@ class SearchParams(RequestOptions): """ cancel_at_period_end: bool """ - Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. This field will be removed in a future API version. Please use `cancel_at` instead. + Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. """ canceled_at: Optional[int] """ @@ -2247,7 +2282,7 @@ class SearchParams(RequestOptions): """ trial_start: Optional[int] """ - If the subscription has a trial, the beginning of that trial. For subsequent trials, this date remains as the start of the first ever trial on the subscription. + If the subscription has a trial, the beginning of that trial. """ @classmethod @@ -2606,6 +2641,116 @@ async def list_async( return result + @classmethod + def _cls_migrate( + cls, subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + cls._static_request( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription) + ), + params=params, + ), + ) + + @overload + @staticmethod + def migrate( + subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @overload + def migrate( + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @class_method_variant("_cls_migrate") + def migrate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + self._request( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_migrate_async( + cls, subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + await cls._static_request_async( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def migrate_async( + subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @overload + async def migrate_async( + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @class_method_variant("_cls_migrate_async") + async def migrate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + await self._request_async( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def modify( cls, id: str, **params: Unpack["Subscription.ModifyParams"] @@ -2855,6 +3000,7 @@ async def search_auto_paging_iter_async( _inner_class_types = { "automatic_tax": AutomaticTax, "billing_cycle_anchor_config": BillingCycleAnchorConfig, + "billing_mode": BillingMode, "billing_thresholds": BillingThresholds, "cancellation_details": CancellationDetails, "invoice_settings": InvoiceSettings, diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 8142d9c0e..77f92b2e4 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -48,6 +48,16 @@ class SubscriptionSchedule( "subscription_schedule" ) + class BillingMode(StripeObject): + type: Literal["classic", "flexible"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + updated_at: Optional[int] + """ + Details on when the current billing_mode was adopted. + """ + class CurrentPhase(StripeObject): end_date: int """ @@ -447,6 +457,12 @@ class CancelParams(RequestOptions): """ class CreateParams(RequestOptions): + billing_mode: NotRequired[ + "SubscriptionSchedule.CreateParamsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. @@ -484,6 +500,9 @@ class CreateParams(RequestOptions): When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. """ + class CreateParamsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsDefaultSettings(TypedDict): application_fee_percent: NotRequired[float] """ @@ -1600,6 +1619,10 @@ class RetrieveParams(RequestOptions): """ ID of the Connect Application that created the schedule. """ + billing_mode: BillingMode + """ + The billing mode of the subscription. + """ canceled_at: Optional[int] """ Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. @@ -2025,6 +2048,7 @@ async def retrieve_async( return instance _inner_class_types = { + "billing_mode": BillingMode, "current_phase": CurrentPhase, "default_settings": DefaultSettings, "phases": Phase, diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 05fb42f95..1e7363509 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -25,6 +25,12 @@ class CancelParams(TypedDict): """ class CreateParams(TypedDict): + billing_mode: NotRequired[ + "SubscriptionScheduleService.CreateParamsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. @@ -64,6 +70,9 @@ class CreateParams(TypedDict): When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. """ + class CreateParamsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsDefaultSettings(TypedDict): application_fee_percent: NotRequired[float] """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 84d636370..93197671a 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -59,11 +59,11 @@ class CreateParams(TypedDict): "SubscriptionService.CreateParamsAutomaticTax" ] """ - Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. + Automatic tax settings for this subscription. """ backdate_start_date: NotRequired[int] """ - For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. """ billing_cycle_anchor: NotRequired[int] """ @@ -75,6 +75,12 @@ class CreateParams(TypedDict): """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ + billing_mode: NotRequired[ + "SubscriptionService.CreateParamsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionService.CreateParamsBillingThresholds" ] @@ -87,7 +93,7 @@ class CreateParams(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] @@ -327,6 +333,9 @@ class CreateParamsBillingCycleAnchorConfig(TypedDict): The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ + class CreateParamsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ @@ -479,7 +488,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -883,6 +892,19 @@ class ListParamsCurrentPeriodStart(TypedDict): Maximum value to filter by (inclusive) """ + class MigrateParams(TypedDict): + billing_mode: "SubscriptionService.MigrateParamsBillingMode" + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class MigrateParamsBillingMode(TypedDict): + type: Literal["flexible"] + class ResumeParams(TypedDict): billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ @@ -960,7 +982,7 @@ class UpdateParams(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancellation_details: NotRequired[ "SubscriptionService.UpdateParamsCancellationDetails" @@ -1364,7 +1386,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1998,6 +2020,50 @@ async def search_async( ), ) + def migrate( + self, + subscription: str, + params: "SubscriptionService.MigrateParams", + options: RequestOptions = {}, + ) -> Subscription: + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + Subscription, + self._request( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def migrate_async( + self, + subscription: str, + params: "SubscriptionService.MigrateParams", + options: RequestOptions = {}, + ) -> Subscription: + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + Subscription, + await self._request_async( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription), + ), + base_address="api", + params=params, + options=options, + ), + ) + def resume( self, subscription: str, diff --git a/stripe/_token.py b/stripe/_token.py index 1d1b28780..240c39ac4 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -174,6 +174,9 @@ class CreateParamsAccountCompany(TypedDict): registration_date: NotRequired[ "Literal['']|Token.CreateParamsAccountCompanyRegistrationDate" ] + """ + When the business was incorporated or registered. + """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 927ef7f39..981996870 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -141,6 +141,9 @@ class CreateParamsAccountCompany(TypedDict): registration_date: NotRequired[ "Literal['']|TokenService.CreateParamsAccountCompanyRegistrationDate" ] + """ + When the business was incorporated or registered. + """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 046ea196f..d75a2f968 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -144,6 +144,7 @@ class CreateParams(RequestOptions): "2025-03-31.basil", "2025-04-30.basil", "2025-05-28.basil", + "2025-06-30.basil", ] ] """ @@ -358,6 +359,7 @@ class CreateParams(RequestOptions): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", @@ -658,6 +660,7 @@ class ModifyParams(RequestOptions): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index c541ef7af..db8117339 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -125,6 +125,7 @@ class CreateParams(TypedDict): "2025-03-31.basil", "2025-04-30.basil", "2025-05-28.basil", + "2025-06-30.basil", ] ] """ @@ -339,6 +340,7 @@ class CreateParams(TypedDict): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", @@ -645,6 +647,7 @@ class UpdateParams(TypedDict): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index a55fcde2d..fabaabffa 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -131,7 +131,7 @@ class Item(StripeObject): discounts: Optional[List[Discount]] """ - The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. + The coupon or promotion code to apply to this subscription update. """ items: List[Item] """ @@ -360,7 +360,7 @@ class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): ] ] """ - The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. + The coupon or promotion code to apply to this subscription update. """ items: List[ "Session.CreateParamsFlowDataSubscriptionUpdateConfirmItem" diff --git a/stripe/billing_portal/_session_service.py b/stripe/billing_portal/_session_service.py index d06d54667..9dbfcdd09 100644 --- a/stripe/billing_portal/_session_service.py +++ b/stripe/billing_portal/_session_service.py @@ -196,7 +196,7 @@ class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): ] ] """ - The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. + The coupon or promotion code to apply to this subscription update. """ items: List[ "SessionService.CreateParamsFlowDataSubscriptionUpdateConfirmItem" diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 820edd5fd..0d1c8d317 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1981,7 +1981,7 @@ class CreateParams(RequestOptions): """ line_items: NotRequired[List["Session.CreateParamsLineItem"]] """ - A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). The parameter is required for `payment` and `subscription` mode. For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. @@ -2103,6 +2103,7 @@ class CreateParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3456,6 +3457,46 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + subscriptions: NotRequired[ + "Literal['']|List[Session.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if the Checkout Session sets up a future subscription. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "Session.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): expires_after_days: NotRequired[int] @@ -4218,6 +4259,12 @@ class CreateParamsSubscriptionData(TypedDict): """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ + billing_mode: NotRequired[ + "Session.CreateParamsSubscriptionDataBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have @@ -4256,14 +4303,11 @@ class CreateParamsSubscriptionData(TypedDict): """ trial_end: NotRequired[int] """ - Unix timestamp representing the end of the trial period the customer - will get before being charged for the first time. Has to be at least - 48 hours in the future. + Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future. """ trial_period_days: NotRequired[int] """ - Integer representing the number of trial period days before the - customer is charged for the first time. Has to be at least 1. + Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ trial_settings: NotRequired[ "Session.CreateParamsSubscriptionDataTrialSettings" @@ -4272,6 +4316,9 @@ class CreateParamsSubscriptionData(TypedDict): Settings related to subscription trials. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "Session.CreateParamsSubscriptionDataInvoiceSettingsIssuer" diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 90df0d46c..2552a1e95 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -130,7 +130,7 @@ class CreateParams(TypedDict): """ line_items: NotRequired[List["SessionService.CreateParamsLineItem"]] """ - A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). The parameter is required for `payment` and `subscription` mode. For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. @@ -254,6 +254,7 @@ class CreateParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1657,6 +1658,46 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + subscriptions: NotRequired[ + "Literal['']|List[SessionService.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if the Checkout Session sets up a future subscription. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SessionService.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): expires_after_days: NotRequired[int] @@ -2419,6 +2460,12 @@ class CreateParamsSubscriptionData(TypedDict): """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ + billing_mode: NotRequired[ + "SessionService.CreateParamsSubscriptionDataBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have @@ -2457,14 +2504,11 @@ class CreateParamsSubscriptionData(TypedDict): """ trial_end: NotRequired[int] """ - Unix timestamp representing the end of the trial period the customer - will get before being charged for the first time. Has to be at least - 48 hours in the future. + Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future. """ trial_period_days: NotRequired[int] """ - Integer representing the number of trial period days before the - customer is charged for the first time. Has to be at least 1. + Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ trial_settings: NotRequired[ "SessionService.CreateParamsSubscriptionDataTrialSettings" @@ -2473,6 +2517,9 @@ class CreateParamsSubscriptionData(TypedDict): Settings related to subscription trials. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "SessionService.CreateParamsSubscriptionDataInvoiceSettingsIssuer" diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 944758ef8..c473ffc47 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -106,6 +106,16 @@ class Email(StripeObject): class IdNumber(StripeObject): pass + class Matching(StripeObject): + dob: Optional[Literal["none", "similar"]] + """ + Strictness of the DOB matching policy to apply. + """ + name: Optional[Literal["none", "similar"]] + """ + Strictness of the name matching policy to apply. + """ + class Phone(StripeObject): require_verification: Optional[bool] """ @@ -115,11 +125,13 @@ class Phone(StripeObject): document: Optional[Document] email: Optional[Email] id_number: Optional[IdNumber] + matching: Optional[Matching] phone: Optional[Phone] _inner_class_types = { "document": Document, "email": Email, "id_number": IdNumber, + "matching": Matching, "phone": Phone, } @@ -139,6 +151,16 @@ class Redaction(StripeObject): Indicates whether this object and its related objects have been redacted or not. """ + class RelatedPerson(StripeObject): + account: Optional[str] + """ + Token referencing the associated Account of the related Person resource. + """ + person: Optional[str] + """ + Token referencing the related Person resource. + """ + class VerifiedOutputs(StripeObject): class Address(StripeObject): city: Optional[str] @@ -259,6 +281,12 @@ class CreateParams(RequestOptions): """ Customer ID """ + related_person: NotRequired[ + "VerificationSession.CreateParamsRelatedPerson" + ] + """ + Tokens referencing a Person resource and it's associated account. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. @@ -310,6 +338,16 @@ class CreateParamsProvidedDetails(TypedDict): Phone number of user being verified """ + class CreateParamsRelatedPerson(TypedDict): + account: str + """ + A token representing a connected account. If provided, the person parameter is also required and must be associated with the account. + """ + person: str + """ + A token referencing a Person resource that this verification is being used to verify. + """ + class ListParams(RequestOptions): client_reference_id: NotRequired[str] """ @@ -487,6 +525,7 @@ class RetrieveParams(RequestOptions): """ Customer ID """ + related_person: Optional[RelatedPerson] status: Literal["canceled", "processing", "requires_input", "verified"] """ Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). @@ -1045,5 +1084,6 @@ async def retrieve_async( "options": Options, "provided_details": ProvidedDetails, "redaction": Redaction, + "related_person": RelatedPerson, "verified_outputs": VerifiedOutputs, } diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index d993d8eea..13aeac2d9 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -43,6 +43,12 @@ class CreateParams(TypedDict): """ Customer ID """ + related_person: NotRequired[ + "VerificationSessionService.CreateParamsRelatedPerson" + ] + """ + Tokens referencing a Person resource and it's associated account. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. @@ -94,6 +100,16 @@ class CreateParamsProvidedDetails(TypedDict): Phone number of user being verified """ + class CreateParamsRelatedPerson(TypedDict): + account: str + """ + A token representing a connected account. If provided, the person parameter is also required and must be associated with the account. + """ + person: str + """ + A token referencing a Person resource that this verification is being used to verify. + """ + class ListParams(TypedDict): client_reference_id: NotRequired[str] """ diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index b3fdd7c16..747ca293b 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -791,6 +791,12 @@ class Tz(StripeObject): Type of registration in `country`. """ + class Ua(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Ug(StripeObject): type: Literal["simplified"] """ @@ -980,6 +986,7 @@ class Zw(StripeObject): tj: Optional[Tj] tr: Optional[Tr] tz: Optional[Tz] + ua: Optional[Ua] ug: Optional[Ug] us: Optional[Us] uy: Optional[Uy] @@ -1079,6 +1086,7 @@ class Zw(StripeObject): "tj": Tj, "tr": Tr, "tz": Tz, + "ua": Ua, "ug": Ug, "us": Us, "uy": Uy, @@ -1473,6 +1481,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in TZ. """ + ua: NotRequired["Registration.CreateParamsCountryOptionsUa"] + """ + Options for the registration in UA. + """ ug: NotRequired["Registration.CreateParamsCountryOptionsUg"] """ Options for the registration in UG. @@ -2382,6 +2394,12 @@ class CreateParamsCountryOptionsTz(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsUa(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUg(TypedDict): type: Literal["simplified"] """ diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index 4e8d85728..f8abadea1 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -397,6 +397,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in TZ. """ + ua: NotRequired["RegistrationService.CreateParamsCountryOptionsUa"] + """ + Options for the registration in UA. + """ ug: NotRequired["RegistrationService.CreateParamsCountryOptionsUg"] """ Options for the registration in UG. @@ -1306,6 +1310,12 @@ class CreateParamsCountryOptionsTz(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsUa(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUg(TypedDict): type: Literal["simplified"] """ diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index f8382d28b..f0162b715 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -30,6 +30,7 @@ class Configuration( ): """ A Configurations object represents how features should be configured for terminal readers. + For information about how to use it, see the [Terminal configurations documentation](https://docs.stripe.com/terminal/fleet/configurations-overview). """ OBJECT_NAME: ClassVar[Literal["terminal.configuration"]] = ( diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index afbad216d..1ce2eb031 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -130,7 +130,7 @@ class ModifyParams(RequestOptions): """ The ID of a configuration that will be used to customize all readers in this location. """ - display_name: NotRequired[str] + display_name: NotRequired["Literal['']|str"] """ A name for the location. """ diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index 6e810861b..8dd6dbf46 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -94,7 +94,7 @@ class UpdateParams(TypedDict): """ The ID of a configuration that will be used to customize all readers in this location. """ - display_name: NotRequired[str] + display_name: NotRequired["Literal['']|str"] """ A name for the location. """ diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index b1ec7dba0..f8f414cbb 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -23,6 +23,7 @@ if TYPE_CHECKING: from stripe._charge import Charge from stripe._payment_intent import PaymentIntent + from stripe._payment_method import PaymentMethod from stripe._refund import Refund from stripe._setup_intent import SetupIntent from stripe.terminal._location import Location @@ -212,6 +213,63 @@ class Toggle(StripeObject): """ _inner_class_types = {"inputs": Input} + class CollectPaymentMethod(StripeObject): + class CollectConfig(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} + + collect_config: Optional[CollectConfig] + """ + Represents a per-transaction override of a reader configuration + """ + payment_intent: ExpandableField["PaymentIntent"] + """ + Most recent PaymentIntent processed by the reader. + """ + 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). + """ + _inner_class_types = {"collect_config": CollectConfig} + + class ConfirmPaymentIntent(StripeObject): + class ConfirmConfig(StripeObject): + return_url: Optional[str] + """ + If the customer doesn't abandon authenticating the payment, they're redirected to this URL after completion. + """ + + confirm_config: Optional[ConfirmConfig] + """ + Represents a per-transaction override of a reader configuration + """ + payment_intent: ExpandableField["PaymentIntent"] + """ + Most recent PaymentIntent processed by the reader. + """ + _inner_class_types = {"confirm_config": ConfirmConfig} + class ProcessPaymentIntent(StripeObject): class ProcessConfig(StripeObject): class Tipping(StripeObject): @@ -222,11 +280,11 @@ class Tipping(StripeObject): enable_customer_cancellation: Optional[bool] """ - Enable customer initiated cancellation when processing this payment. + Enable customer-initiated cancellation when processing this payment. """ return_url: Optional[str] """ - If the customer does not abandon authenticating the payment, they will be redirected to this specified URL after completion. + If the customer doesn't abandon authenticating the payment, they're redirected to this URL after completion. """ skip_tipping: Optional[bool] """ @@ -252,7 +310,7 @@ class ProcessSetupIntent(StripeObject): class ProcessConfig(StripeObject): enable_customer_cancellation: Optional[bool] """ - Enable customer initiated cancellation when processing this SetupIntent. + Enable customer-initiated cancellation when processing this SetupIntent. """ generated_card: Optional[str] @@ -273,7 +331,7 @@ class RefundPayment(StripeObject): class RefundPaymentConfig(StripeObject): enable_customer_cancellation: Optional[bool] """ - Enable customer initiated cancellation when refunding this payment. + Enable customer-initiated cancellation when refunding this payment. """ amount: Optional[int] @@ -364,6 +422,14 @@ class LineItem(StripeObject): """ Represents a reader action to collect customer inputs """ + collect_payment_method: Optional[CollectPaymentMethod] + """ + Represents a reader action to collect a payment method + """ + confirm_payment_intent: Optional[ConfirmPaymentIntent] + """ + Represents a reader action to confirm a payment + """ failure_code: Optional[str] """ Failure code, only set if status is `failed`. @@ -394,6 +460,8 @@ class LineItem(StripeObject): """ type: Literal[ "collect_inputs", + "collect_payment_method", + "confirm_payment_intent", "process_payment_intent", "process_setup_intent", "refund_payment", @@ -404,6 +472,8 @@ class LineItem(StripeObject): """ _inner_class_types = { "collect_inputs": CollectInputs, + "collect_payment_method": CollectPaymentMethod, + "confirm_payment_intent": ConfirmPaymentIntent, "process_payment_intent": ProcessPaymentIntent, "process_setup_intent": ProcessSetupIntent, "refund_payment": RefundPayment, @@ -506,6 +576,72 @@ class CollectInputsParamsInputToggle(TypedDict): The title which will be displayed for the toggle """ + class CollectPaymentMethodParams(RequestOptions): + collect_config: NotRequired[ + "Reader.CollectPaymentMethodParamsCollectConfig" + ] + """ + Configuration overrides. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID. + """ + + class CollectPaymentMethodParamsCollectConfig(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. + """ + 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.CollectPaymentMethodParamsCollectConfigTipping" + ] + """ + Tipping configuration for this transaction. + """ + + class CollectPaymentMethodParamsCollectConfigTipping(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 ConfirmPaymentIntentParams(RequestOptions): + confirm_config: NotRequired[ + "Reader.ConfirmPaymentIntentParamsConfirmConfig" + ] + """ + Configuration overrides. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID. + """ + + class ConfirmPaymentIntentParamsConfirmConfig(TypedDict): + 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. + """ + class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -1096,6 +1232,226 @@ async def collect_inputs_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_collect_payment_method( + cls, reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + cls._static_request( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + def collect_payment_method( + reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @overload + def collect_payment_method( + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @class_method_variant("_cls_collect_payment_method") + def collect_payment_method( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + self._request( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_collect_payment_method_async( + cls, reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def collect_payment_method_async( + reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @overload + async def collect_payment_method_async( + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @class_method_variant("_cls_collect_payment_method_async") + async def collect_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_confirm_payment_intent( + cls, reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + cls._static_request( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + def confirm_payment_intent( + reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @overload + def confirm_payment_intent( + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @class_method_variant("_cls_confirm_payment_intent") + def confirm_payment_intent( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + self._request( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_confirm_payment_intent_async( + cls, reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def confirm_payment_intent_async( + reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @overload + async def confirm_payment_intent_async( + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @class_method_variant("_cls_confirm_payment_intent_async") + async def confirm_payment_intent_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Reader.CreateParams"]) -> "Reader": """ diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 8ac8022a7..d55f5b6e7 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -110,6 +110,72 @@ class CollectInputsParamsInputToggle(TypedDict): The title which will be displayed for the toggle """ + class CollectPaymentMethodParams(TypedDict): + collect_config: NotRequired[ + "ReaderService.CollectPaymentMethodParamsCollectConfig" + ] + """ + Configuration overrides. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID. + """ + + class CollectPaymentMethodParamsCollectConfig(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. + """ + 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.CollectPaymentMethodParamsCollectConfigTipping" + ] + """ + Tipping configuration for this transaction. + """ + + class CollectPaymentMethodParamsCollectConfigTipping(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 ConfirmPaymentIntentParams(TypedDict): + confirm_config: NotRequired[ + "ReaderService.ConfirmPaymentIntentParamsConfirmConfig" + ] + """ + Configuration overrides. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID. + """ + + class ConfirmPaymentIntentParamsConfirmConfig(TypedDict): + 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. + """ + class CreateParams(TypedDict): expand: NotRequired[List[str]] """ @@ -659,6 +725,94 @@ async def collect_inputs_async( ), ) + def collect_payment_method( + self, + reader: str, + params: "ReaderService.CollectPaymentMethodParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + Reader, + self._request( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def collect_payment_method_async( + self, + reader: str, + params: "ReaderService.CollectPaymentMethodParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def confirm_payment_intent( + self, + reader: str, + params: "ReaderService.ConfirmPaymentIntentParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Finalizes a payment on a Reader. + """ + return cast( + Reader, + self._request( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def confirm_payment_intent_async( + self, + reader: str, + params: "ReaderService.ConfirmPaymentIntentParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Finalizes a payment on a Reader. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + def process_payment_intent( self, reader: str, diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 1fcab8016..c9d83f11e 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -135,6 +135,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -345,6 +351,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -518,6 +525,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -603,6 +613,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -844,9 +855,9 @@ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsShipping(TypedDict): diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 8b002e6f7..5b4815a40 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -339,6 +339,10 @@ class ListParams(RequestOptions): """ An object ID cursor for use in pagination. """ + status: NotRequired[Literal["closed", "open"]] + """ + Only return FinancialAccounts that have the given status: `open` or `closed` + """ class ListParamsCreated(TypedDict): gt: NotRequired[int] diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index 6cc6f577d..849d594c9 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -244,6 +244,10 @@ class ListParams(TypedDict): """ An object ID cursor for use in pagination. """ + status: NotRequired[Literal["closed", "open"]] + """ + Only return FinancialAccounts that have the given status: `open` or `closed` + """ class ListParamsCreated(TypedDict): gt: NotRequired[int] From b768364d938a1f1110bdefd99cf850d4c3c507f1 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 13:28:01 +0000 Subject: [PATCH 8/8] Update generated code for v1819 and 2025-06-30.basil --- stripe/_account.py | 8 +- stripe/_apple_pay_domain.py | 8 +- stripe/_application.py | 8 +- stripe/_bank_account.py | 8 +- stripe/_card.py | 8 +- stripe/_coupon.py | 8 +- stripe/_customer.py | 8 +- stripe/_discount.py | 8 +- stripe/_invoice.py | 8 +- stripe/_invoice_item.py | 8 +- stripe/_person.py | 8 +- stripe/_plan.py | 8 +- stripe/_price.py | 8 +- stripe/_product.py | 8 +- stripe/_product_feature.py | 8 +- stripe/_subscription_item.py | 8 +- stripe/_tax_id.py | 8 +- stripe/_webhook_endpoint.py | 8 +- stripe/radar/_value_list.py | 8 +- stripe/radar/_value_list_item.py | 8 +- stripe/terminal/_configuration.py | 8 +- stripe/terminal/_location.py | 8 +- stripe/terminal/_reader.py | 8 +- stripe/test_helpers/_test_clock.py | 8 +- stripe/v2/_billing_service.py | 2 +- stripe/v2/_event.py | 16 +- stripe/v2/_event_destination.py | 44 ++--- stripe/v2/billing/_meter_event.py | 8 +- stripe/v2/billing/_meter_event_adjustment.py | 8 +- stripe/v2/billing/_meter_event_session.py | 8 +- stripe/v2/core/_event_destination_service.py | 196 +++++++++---------- tests/test_generated_examples.py | 120 ++++++------ 32 files changed, 297 insertions(+), 297 deletions(-) diff --git a/stripe/_account.py b/stripe/_account.py index 98bdb9fa3..0ef74b02c 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -4523,6 +4523,10 @@ class RetrievePersonParams(RequestOptions): """ Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ details_submitted: Optional[bool] """ Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](https://docs.stripe.com/connect/onboarding) to finish submitting account details. @@ -4574,10 +4578,6 @@ class RetrievePersonParams(RequestOptions): """ The Stripe account type. Can be `standard`, `express`, `custom`, or `none`. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Account.CreateParams"]) -> "Account": diff --git a/stripe/_apple_pay_domain.py b/stripe/_apple_pay_domain.py index e88f6a708..1961b46ea 100644 --- a/stripe/_apple_pay_domain.py +++ b/stripe/_apple_pay_domain.py @@ -56,6 +56,10 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ domain_name: str id: str """ @@ -69,10 +73,6 @@ class RetrieveParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/_application.py b/stripe/_application.py index 3b0e64add..dee1e54fd 100644 --- a/stripe/_application.py +++ b/stripe/_application.py @@ -7,6 +7,10 @@ class Application(StripeObject): OBJECT_NAME: ClassVar[Literal["application"]] = "application" + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -19,7 +23,3 @@ class Application(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 82c0217a8..42821194d 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -335,6 +335,10 @@ class DeleteParams(RequestOptions): """ Whether this bank account is the default external account for its currency. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. @@ -373,10 +377,6 @@ class DeleteParams(RequestOptions): For external accounts, possible values are `new`, `errored` and `verification_failed`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_delete( diff --git a/stripe/_card.py b/stripe/_card.py index fc8aaa48b..c4b8bd539 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -101,6 +101,10 @@ class DeleteParams(RequestOptions): """ Whether this card is the default external account for its currency. This property is only available for accounts where [controller.requirement_collection](https://docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) @@ -168,10 +172,6 @@ class DeleteParams(RequestOptions): """ If the card number is tokenized, this is the method that was used. Can be `android_pay` (includes Google Pay), `apple_pay`, `masterpass`, `visa_checkout`, or null. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_delete( diff --git a/stripe/_coupon.py b/stripe/_coupon.py index 9b9a1c518..1aa9c2580 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -198,6 +198,10 @@ class RetrieveParams(RequestOptions): """ Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ duration: Literal["forever", "once", "repeating"] """ One of `forever`, `once`, or `repeating`. Describes how long a customer who applies this coupon will get the discount. @@ -246,10 +250,6 @@ class RetrieveParams(RequestOptions): """ Taking account of the above properties, whether this coupon can still be applied to a customer. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Coupon.CreateParams"]) -> "Coupon": diff --git a/stripe/_customer.py b/stripe/_customer.py index 820b5e28f..3fc4cf423 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -1436,6 +1436,10 @@ class SearchParams(RequestOptions): If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ delinquent: Optional[bool] """ Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. @@ -1524,10 +1528,6 @@ class SearchParams(RequestOptions): """ ID of the test clock that this customer belongs to. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Customer.CreateParams"]) -> "Customer": diff --git a/stripe/_discount.py b/stripe/_discount.py index f8475423e..bda0a2f29 100644 --- a/stripe/_discount.py +++ b/stripe/_discount.py @@ -34,6 +34,10 @@ class Discount(StripeObject): """ The ID of the customer associated with this discount. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ end: Optional[int] """ If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null. @@ -70,7 +74,3 @@ class Discount(StripeObject): """ The subscription item that this coupon is applied to, if it is applied to a particular subscription item. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 43c483457..b4e9fa5e3 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -4266,6 +4266,10 @@ class VoidInvoiceParams(RequestOptions): """ The tax rates applied to this invoice, if any. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. @@ -4434,10 +4438,6 @@ class VoidInvoiceParams(RequestOptions): """ Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_add_lines( diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 17e27894a..2755a1cf7 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -423,6 +423,10 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. @@ -480,10 +484,6 @@ class RetrieveParams(RequestOptions): """ ID of the test clock this invoice item belongs to. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/_person.py b/stripe/_person.py index 94f6d3a18..488960df5 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -654,6 +654,10 @@ class Document(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ dob: Optional[Dob] email: Optional[str] """ @@ -746,10 +750,6 @@ class Document(StripeObject): Demographic data related to the person. """ verification: Optional[Verification] - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ def instance_url(self): token = self.id diff --git a/stripe/_plan.py b/stripe/_plan.py index 113731060..6a66982df 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -315,6 +315,10 @@ class RetrieveParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -371,10 +375,6 @@ class RetrieveParams(RequestOptions): """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Plan.CreateParams"]) -> "Plan": diff --git a/stripe/_price.py b/stripe/_price.py index e85e365eb..f3f4edaa6 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -663,6 +663,10 @@ class SearchParams(RequestOptions): """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -723,10 +727,6 @@ class SearchParams(RequestOptions): """ The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Price.CreateParams"]) -> "Price": diff --git a/stripe/_product.py b/stripe/_product.py index 98bfb87b1..3ee2a67cd 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -542,6 +542,10 @@ class SearchParams(RequestOptions): """ The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. @@ -606,10 +610,6 @@ class SearchParams(RequestOptions): """ A URL of a publicly-accessible webpage for this product. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Product.CreateParams"]) -> "Product": diff --git a/stripe/_product_feature.py b/stripe/_product_feature.py index e17e01a41..322a8367e 100644 --- a/stripe/_product_feature.py +++ b/stripe/_product_feature.py @@ -15,6 +15,10 @@ class ProductFeature(StripeObject): """ OBJECT_NAME: ClassVar[Literal["product_feature"]] = "product_feature" + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ entitlement_feature: "Feature" """ A feature represents a monetizable ability or functionality in your system. @@ -32,7 +36,3 @@ class ProductFeature(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 173c230aa..944ad0495 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -366,6 +366,10 @@ class RetrieveParams(RequestOptions): """ The start time of this subscription item's current billing period. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ discounts: List[ExpandableField["Discount"]] """ The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. @@ -414,10 +418,6 @@ class RetrieveParams(RequestOptions): """ 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( diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 89125eded..8ec276c9d 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -269,6 +269,10 @@ class RetrieveParams(RequestOptions): """ ID of the customer. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -409,10 +413,6 @@ class RetrieveParams(RequestOptions): """ Tax ID verification information. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["TaxId.CreateParams"]) -> "TaxId": diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index d75a2f968..695757c4e 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -748,6 +748,10 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ An optional description of what the webhook is used for. @@ -784,10 +788,6 @@ class RetrieveParams(RequestOptions): """ The URL of the webhook endpoint. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index c4c41f808..5fd7a3b34 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -156,6 +156,10 @@ class RetrieveParams(RequestOptions): """ The name or email address of the user who created this value list. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -195,10 +199,6 @@ class RetrieveParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["ValueList.CreateParams"]) -> "ValueList": diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index 36c42a870..bac22806e 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -104,6 +104,10 @@ class RetrieveParams(RequestOptions): """ The name or email address of the user who added this item to the value list. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -124,10 +128,6 @@ class RetrieveParams(RequestOptions): """ The identifier of the value list this item belongs to. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index f0162b715..058a261ce 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -1309,6 +1309,10 @@ class RetrieveParams(RequestOptions): """ bbpos_wisepos_e: Optional[BbposWiseposE] + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -1335,10 +1339,6 @@ class RetrieveParams(RequestOptions): tipping: Optional[Tipping] verifone_p400: Optional[VerifoneP400] wifi: Optional[Wifi] - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index 1ce2eb031..f9c00783c 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -180,6 +180,10 @@ class RetrieveParams(RequestOptions): """ The ID of a configuration that will be used to customize all readers in this location. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ display_name: str """ The display name of the location. @@ -200,10 +204,6 @@ class RetrieveParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Location.CreateParams"]) -> "Location": diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index f8f414cbb..01a09f2b5 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -953,6 +953,10 @@ class TimeoutInputCollectionParams(RequestOptions): """ The most recent action performed by the reader. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ device_sw_version: Optional[str] """ The current software version of the reader. @@ -1007,10 +1011,6 @@ class TimeoutInputCollectionParams(RequestOptions): """ The networking status of the reader. We do not recommend using this field in flows that may block taking payments. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_cancel_action( diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index 0bee1d8f0..df06b4e03 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -91,6 +91,10 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ deletes_after: int """ Time at which this clock is scheduled to auto delete. @@ -120,10 +124,6 @@ class RetrieveParams(RequestOptions): The status of the Test Clock. """ status_details: StatusDetails - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_advance( diff --git a/stripe/v2/_billing_service.py b/stripe/v2/_billing_service.py index 77d36d39a..3ba51acf7 100644 --- a/stripe/v2/_billing_service.py +++ b/stripe/v2/_billing_service.py @@ -16,9 +16,9 @@ class BillingService(StripeService): def __init__(self, requestor): super().__init__(requestor) - self.meter_event_session = MeterEventSessionService(self._requestor) self.meter_event_adjustments = MeterEventAdjustmentService( self._requestor, ) + self.meter_event_session = MeterEventSessionService(self._requestor) self.meter_event_stream = MeterEventStreamService(self._requestor) self.meter_events = MeterEventService(self._requestor) diff --git a/stripe/v2/_event.py b/stripe/v2/_event.py index bf45c2ed0..0e46a2b66 100644 --- a/stripe/v2/_event.py +++ b/stripe/v2/_event.py @@ -30,14 +30,14 @@ class Request(StripeObject): The idempotency key transmitted during the request. """ - type: Literal["request"] - """ - Event reason type. - """ request: Optional[Request] """ Information on the API request that instigated the event. """ + type: Literal["request"] + """ + Event reason type. + """ _inner_class_types = {"request": Request} context: Optional[str] @@ -52,6 +52,10 @@ class Request(StripeObject): """ Unique identifier for the event. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ object: Literal["v2.core.event"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -64,10 +68,6 @@ class Request(StripeObject): """ The type of the event. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ _inner_class_types = {"reason": Reason} diff --git a/stripe/v2/_event_destination.py b/stripe/v2/_event_destination.py index 82203a865..02d4ca172 100644 --- a/stripe/v2/_event_destination.py +++ b/stripe/v2/_event_destination.py @@ -14,19 +14,6 @@ class EventDestination(StripeObject): "v2.core.event_destination" ) - class StatusDetails(StripeObject): - class Disabled(StripeObject): - reason: Literal["no_aws_event_source_exists", "user"] - """ - Reason event destination has been disabled. - """ - - disabled: Optional[Disabled] - """ - Details about why the event destination has been disabled. - """ - _inner_class_types = {"disabled": Disabled} - class AmazonEventbridge(StripeObject): aws_account_id: str """ @@ -43,6 +30,19 @@ class AmazonEventbridge(StripeObject): The state of the AWS event source. """ + class StatusDetails(StripeObject): + class Disabled(StripeObject): + reason: Literal["no_aws_event_source_exists", "user"] + """ + Reason event destination has been disabled. + """ + + disabled: Optional[Disabled] + """ + Details about why the event destination has been disabled. + """ + _inner_class_types = {"disabled": Disabled} + class WebhookEndpoint(StripeObject): signing_secret: Optional[str] """ @@ -53,6 +53,10 @@ class WebhookEndpoint(StripeObject): The URL of the webhook endpoint, includable. """ + amazon_eventbridge: Optional[AmazonEventbridge] + """ + Amazon EventBridge configuration. + """ created: str """ Time at which the object was created. @@ -77,6 +81,10 @@ class WebhookEndpoint(StripeObject): """ Unique identifier for the object. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ metadata: Optional[Dict[str, str]] """ Metadata. @@ -109,20 +117,12 @@ class WebhookEndpoint(StripeObject): """ Time at which the object was last updated. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - amazon_eventbridge: Optional[AmazonEventbridge] - """ - Amazon EventBridge configuration. - """ webhook_endpoint: Optional[WebhookEndpoint] """ Webhook endpoint configuration. """ _inner_class_types = { - "status_details": StatusDetails, "amazon_eventbridge": AmazonEventbridge, + "status_details": StatusDetails, "webhook_endpoint": WebhookEndpoint, } diff --git a/stripe/v2/billing/_meter_event.py b/stripe/v2/billing/_meter_event.py index 011fb1b81..9d5a304dd 100644 --- a/stripe/v2/billing/_meter_event.py +++ b/stripe/v2/billing/_meter_event.py @@ -25,6 +25,10 @@ class MeterEvent(StripeObject): """ A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ object: Literal["v2.billing.meter_event"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -40,7 +44,3 @@ class MeterEvent(StripeObject): The time of the event. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ diff --git a/stripe/v2/billing/_meter_event_adjustment.py b/stripe/v2/billing/_meter_event_adjustment.py index 980d9ab33..662e8b9bc 100644 --- a/stripe/v2/billing/_meter_event_adjustment.py +++ b/stripe/v2/billing/_meter_event_adjustment.py @@ -32,6 +32,10 @@ class Cancel(StripeObject): """ The unique id of this meter event adjustment. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ object: Literal["v2.billing.meter_event_adjustment"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -44,8 +48,4 @@ class Cancel(StripeObject): """ Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ _inner_class_types = {"cancel": Cancel} diff --git a/stripe/v2/billing/_meter_event_session.py b/stripe/v2/billing/_meter_event_session.py index e00933d4a..8a6d47538 100644 --- a/stripe/v2/billing/_meter_event_session.py +++ b/stripe/v2/billing/_meter_event_session.py @@ -26,11 +26,11 @@ class MeterEventSession(StripeObject): """ The unique id of this auth session. """ - object: Literal["v2.billing.meter_event_session"] - """ - String representing the object's type. Objects of the same type share the same value of the object field. - """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + object: Literal["v2.billing.meter_event_session"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ diff --git a/stripe/v2/core/_event_destination_service.py b/stripe/v2/core/_event_destination_service.py index 0aa84c4ba..b8e78c65e 100644 --- a/stripe/v2/core/_event_destination_service.py +++ b/stripe/v2/core/_event_destination_service.py @@ -145,6 +145,44 @@ class UpdateParamsWebhookEndpoint(TypedDict): The URL of the webhook endpoint. """ + def list( + self, + params: "EventDestinationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[EventDestination]: + """ + Lists all event destinations. + """ + return cast( + ListObject[EventDestination], + self._request( + "get", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "EventDestinationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[EventDestination]: + """ + Lists all event destinations. + """ + return cast( + ListObject[EventDestination], + await self._request_async( + "get", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "EventDestinationService.CreateParams", @@ -223,146 +261,100 @@ async def delete_async( ), ) - def disable( + def retrieve( self, id: str, - params: "EventDestinationService.DisableParams" = {}, + params: "EventDestinationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Disable an event destination. + Retrieves the details of an event destination. """ return cast( EventDestination, self._request( - "post", - "/v2/core/event_destinations/{id}/disable".format( - id=sanitize_id(id), - ), + "get", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - async def disable_async( + async def retrieve_async( self, id: str, - params: "EventDestinationService.DisableParams" = {}, + params: "EventDestinationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Disable an event destination. + Retrieves the details of an event destination. """ return cast( EventDestination, await self._request_async( - "post", - "/v2/core/event_destinations/{id}/disable".format( - id=sanitize_id(id), - ), + "get", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - def enable( + def update( self, id: str, - params: "EventDestinationService.EnableParams" = {}, + params: "EventDestinationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Enable an event destination. + Update the details of an event destination. """ return cast( EventDestination, self._request( "post", - "/v2/core/event_destinations/{id}/enable".format( - id=sanitize_id(id), - ), + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - async def enable_async( + async def update_async( self, id: str, - params: "EventDestinationService.EnableParams" = {}, + params: "EventDestinationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Enable an event destination. + Update the details of an event destination. """ return cast( EventDestination, await self._request_async( "post", - "/v2/core/event_destinations/{id}/enable".format( - id=sanitize_id(id), - ), - base_address="api", - params=params, - options=options, - ), - ) - - def list( - self, - params: "EventDestinationService.ListParams" = {}, - options: RequestOptions = {}, - ) -> ListObject[EventDestination]: - """ - Lists all event destinations. - """ - return cast( - ListObject[EventDestination], - self._request( - "get", - "/v2/core/event_destinations", - base_address="api", - params=params, - options=options, - ), - ) - - async def list_async( - self, - params: "EventDestinationService.ListParams" = {}, - options: RequestOptions = {}, - ) -> ListObject[EventDestination]: - """ - Lists all event destinations. - """ - return cast( - ListObject[EventDestination], - await self._request_async( - "get", - "/v2/core/event_destinations", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - def ping( + def disable( self, id: str, - params: "EventDestinationService.PingParams" = {}, + params: "EventDestinationService.DisableParams" = {}, options: RequestOptions = {}, - ) -> Event: + ) -> EventDestination: """ - Send a `ping` event to an event destination. + Disable an event destination. """ return cast( - Event, + EventDestination, self._request( "post", - "/v2/core/event_destinations/{id}/ping".format( + "/v2/core/event_destinations/{id}/disable".format( id=sanitize_id(id), ), base_address="api", @@ -371,20 +363,20 @@ def ping( ), ) - async def ping_async( + async def disable_async( self, id: str, - params: "EventDestinationService.PingParams" = {}, + params: "EventDestinationService.DisableParams" = {}, options: RequestOptions = {}, - ) -> Event: + ) -> EventDestination: """ - Send a `ping` event to an event destination. + Disable an event destination. """ return cast( - Event, + EventDestination, await self._request_async( "post", - "/v2/core/event_destinations/{id}/ping".format( + "/v2/core/event_destinations/{id}/disable".format( id=sanitize_id(id), ), base_address="api", @@ -393,80 +385,88 @@ async def ping_async( ), ) - def retrieve( + def enable( self, id: str, - params: "EventDestinationService.RetrieveParams" = {}, + params: "EventDestinationService.EnableParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Retrieves the details of an event destination. + Enable an event destination. """ return cast( EventDestination, self._request( - "get", - "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + "post", + "/v2/core/event_destinations/{id}/enable".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def retrieve_async( + async def enable_async( self, id: str, - params: "EventDestinationService.RetrieveParams" = {}, + params: "EventDestinationService.EnableParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Retrieves the details of an event destination. + Enable an event destination. """ return cast( EventDestination, await self._request_async( - "get", - "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + "post", + "/v2/core/event_destinations/{id}/enable".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - def update( + def ping( self, id: str, - params: "EventDestinationService.UpdateParams" = {}, + params: "EventDestinationService.PingParams" = {}, options: RequestOptions = {}, - ) -> EventDestination: + ) -> Event: """ - Update the details of an event destination. + Send a `ping` event to an event destination. """ return cast( - EventDestination, + Event, self._request( "post", - "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + "/v2/core/event_destinations/{id}/ping".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def update_async( + async def ping_async( self, id: str, - params: "EventDestinationService.UpdateParams" = {}, + params: "EventDestinationService.PingParams" = {}, options: RequestOptions = {}, - ) -> EventDestination: + ) -> Event: """ - Update the details of an event destination. + Send a `ping` event to an event destination. """ return cast( - EventDestination, + Event, await self._request_async( "post", - "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + "/v2/core/event_destinations/{id}/ping".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 90094e144..be4386aa5 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -32990,53 +32990,53 @@ async def test_webhook_endpoints_post_2_service_async( post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) - def test_v2_billing_meter_event_session_post_service( + def test_v2_billing_meter_event_adjustment_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/billing/meter_event_session", + "/v2/billing/meter_event_adjustments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_event_session.create() + client.v2.billing.meter_event_adjustments.create( + { + "cancel": {"identifier": "identifier"}, + "event_name": "event_name", + "type": "cancel", + } + ) http_client_mock.assert_requested( "post", - path="/v2/billing/meter_event_session", + path="/v2/billing/meter_event_adjustments", query_string="", api_base="https://api.stripe.com", - post_data="{}", + post_data='{"cancel":{"identifier":"identifier"},"event_name":"event_name","type":"cancel"}', is_json=True, ) - def test_v2_billing_meter_event_adjustment_post_service( + def test_v2_billing_meter_event_session_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/billing/meter_event_adjustments", + "/v2/billing/meter_event_session", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_event_adjustments.create( - { - "cancel": {"identifier": "identifier"}, - "event_name": "event_name", - "type": "cancel", - } - ) + client.v2.billing.meter_event_session.create() http_client_mock.assert_requested( "post", - path="/v2/billing/meter_event_adjustments", + path="/v2/billing/meter_event_session", query_string="", api_base="https://api.stripe.com", - post_data='{"cancel":{"identifier":"identifier"},"event_name":"event_name","type":"cancel"}', + post_data="{}", is_json=True, ) @@ -33100,6 +33100,26 @@ def test_v2_billing_meter_event_post_service( is_json=True, ) + def test_v2_core_event_destination_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/event_destinations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.list() + http_client_mock.assert_requested( + "get", + path="/v2/core/event_destinations", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_core_event_destination_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -33149,68 +33169,68 @@ def test_v2_core_event_destination_delete_service( api_base="https://api.stripe.com", ) - def test_v2_core_event_destination_post_2_service( + def test_v2_core_event_destination_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/core/event_destinations/id_123/disable", + "get", + "/v2/core/event_destinations/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.disable("id_123") + client.v2.core.event_destinations.retrieve("id_123") http_client_mock.assert_requested( - "post", - path="/v2/core/event_destinations/id_123/disable", + "get", + path="/v2/core/event_destinations/id_123", query_string="", api_base="https://api.stripe.com", - post_data="{}", - is_json=True, ) - def test_v2_core_event_destination_post_3_service( + def test_v2_core_event_destination_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/event_destinations/id_123/enable", + "/v2/core/event_destinations/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.enable("id_123") + client.v2.core.event_destinations.update("id_123") http_client_mock.assert_requested( "post", - path="/v2/core/event_destinations/id_123/enable", + path="/v2/core/event_destinations/id_123", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_core_event_destination_get_service( + def test_v2_core_event_destination_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v2/core/event_destinations", + "post", + "/v2/core/event_destinations/id_123/disable", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.list() + client.v2.core.event_destinations.disable("id_123") http_client_mock.assert_requested( - "get", - path="/v2/core/event_destinations", + "post", + path="/v2/core/event_destinations/id_123/disable", query_string="", api_base="https://api.stripe.com", + post_data="{}", + is_json=True, ) def test_v2_core_event_destination_post_4_service( @@ -33218,59 +33238,39 @@ def test_v2_core_event_destination_post_4_service( ) -> None: http_client_mock.stub_request( "post", - "/v2/core/event_destinations/id_123/ping", + "/v2/core/event_destinations/id_123/enable", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.ping("id_123") + client.v2.core.event_destinations.enable("id_123") http_client_mock.assert_requested( "post", - path="/v2/core/event_destinations/id_123/ping", + path="/v2/core/event_destinations/id_123/enable", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_core_event_destination_get_2_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v2/core/event_destinations/id_123", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.core.event_destinations.retrieve("id_123") - http_client_mock.assert_requested( - "get", - path="/v2/core/event_destinations/id_123", - query_string="", - api_base="https://api.stripe.com", - ) - def test_v2_core_event_destination_post_5_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/event_destinations/id_123", + "/v2/core/event_destinations/id_123/ping", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.update("id_123") + client.v2.core.event_destinations.ping("id_123") http_client_mock.assert_requested( "post", - path="/v2/core/event_destinations/id_123", + path="/v2/core/event_destinations/id_123/ping", query_string="", api_base="https://api.stripe.com", post_data="{}",