diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e584de47..ed94d9d8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.44.0" + ".": "4.45.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index b9f26ca4..8fee554b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-033643979990e894363554df06218fabe4493feaa569a013dbdf9a72aa21c45f.yml -openapi_spec_hash: dd9d320ad178bafa06f1eac2977e2ca7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7936e3f73bbe1d59d27fd7a8a226985927b38fdec1c936c77577381699fb6140.yml +openapi_spec_hash: 1d3f9ed5fbdb0e40d56d6acd9d1736e2 config_hash: e6db17547fe854b1c240407cf4c6dc9e diff --git a/CHANGELOG.md b/CHANGELOG.md index 7729bcb1..875c437b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 4.45.0 (2025-12-03) + +Full Changelog: [v4.44.0...v4.45.0](https://github.com/orbcorp/orb-python/compare/v4.44.0...v4.45.0) + +### Features + +* **api:** api update ([3959281](https://github.com/orbcorp/orb-python/commit/3959281daeb67e4c41bade06590d66a246659d86)) + + +### Chores + +* **docs:** use environment variables for authentication in code snippets ([5527cac](https://github.com/orbcorp/orb-python/commit/5527cac85f39a9178e2ea77203bbc8141f1bbca5)) +* update lockfile ([b78de8a](https://github.com/orbcorp/orb-python/commit/b78de8a33d1cea6a7de2c018ba98b8014e8f3e68)) + ## 4.44.0 (2025-12-02) Full Changelog: [v4.43.1...v4.44.0](https://github.com/orbcorp/orb-python/compare/v4.43.1...v4.44.0) diff --git a/README.md b/README.md index 29478566..c1c329d0 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ pip install orb-billing[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python +import os import asyncio from orb import DefaultAioHttpClient from orb import AsyncOrb @@ -90,7 +91,7 @@ from orb import AsyncOrb async def main() -> None: async with AsyncOrb( - api_key="My API Key", + api_key=os.environ.get("ORB_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: customer = await client.customers.create( diff --git a/pyproject.toml b/pyproject.toml index 96e87238..43be67d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,22 @@ [project] name = "orb-billing" -version = "4.44.0" +version = "4.45.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" authors = [ { name = "Orb", email = "team@withorb.com" }, ] + dependencies = [ - "httpx>=0.23.0, <1", - "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", - "anyio>=3.5.0, <5", - "distro>=1.7.0, <2", - "sniffio", + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.10, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", ] + requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", diff --git a/requirements-dev.lock b/requirements-dev.lock index 0490a020..46a5f8c3 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,40 +12,45 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via httpx-aiohttp # via orb-billing -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via httpx # via orb-billing -argcomplete==3.1.2 +argcomplete==3.6.3 # via nox async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 + # via nox +backports-asyncio-runner==1.2.0 + # via pytest-asyncio +certifi==2025.11.12 # via httpcore # via httpx -colorlog==6.7.0 +colorlog==6.10.1 + # via nox +dependency-groups==1.3.1 # via nox -dirty-equals==0.6.0 -distlib==0.3.7 +dirty-equals==0.11 +distlib==0.4.0 # via virtualenv -distro==1.8.0 +distro==1.9.0 # via orb-billing -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio # via pytest -execnet==2.1.1 +execnet==2.1.2 # via pytest-xdist -filelock==3.12.4 +filelock==3.19.1 # via virtualenv -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -58,82 +63,87 @@ httpx==0.28.1 # via respx httpx-aiohttp==0.1.9 # via orb-billing -idna==3.4 +humanize==4.13.0 + # via nox +idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==7.0.0 -iniconfig==2.0.0 +importlib-metadata==8.7.0 +iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl mypy==1.17.0 -mypy-extensions==1.0.0 +mypy-extensions==1.1.0 # via mypy -nodeenv==1.8.0 +nodeenv==1.9.1 # via pyright -nox==2023.4.22 -packaging==23.2 +nox==2025.11.12 +packaging==25.0 + # via dependency-groups # via nox # via pytest pathspec==0.12.1 # via mypy -platformdirs==3.11.0 +platformdirs==4.4.0 # via virtualenv -pluggy==1.5.0 +pluggy==1.6.0 # via pytest -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via orb-billing -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -pygments==2.18.0 +pygments==2.19.2 + # via pytest # via rich pyright==1.1.399 -pytest==8.3.3 +pytest==8.4.2 # via pytest-asyncio # via pytest-xdist -pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.8.2 +pytest-asyncio==1.2.0 +pytest-xdist==3.8.0 +python-dateutil==2.9.0.post0 # via time-machine -pytz==2023.3.post1 - # via dirty-equals respx==0.22.0 -rich==13.7.1 -ruff==0.9.4 -setuptools==68.2.2 - # via nodeenv -six==1.16.0 +rich==14.2.0 +ruff==0.14.7 +six==1.17.0 # via python-dateutil -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via orb-billing -time-machine==2.9.0 -tomli==2.0.2 +time-machine==2.19.0 +tomli==2.3.0 + # via dependency-groups # via mypy + # via nox # via pytest -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via multidict # via mypy # via orb-billing # via pydantic # via pydantic-core # via pyright + # via pytest-asyncio # via typing-inspection -typing-inspection==0.4.1 + # via virtualenv +typing-inspection==0.4.2 # via pydantic -virtualenv==20.24.5 +virtualenv==20.35.4 # via nox -yarl==1.20.0 +yarl==1.22.0 # via aiohttp -zipp==3.17.0 +zipp==3.23.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index 212262d6..46d84726 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,28 +12,28 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via httpx-aiohttp # via orb-billing -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via httpx # via orb-billing async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 +certifi==2025.11.12 # via httpcore # via httpx -distro==1.8.0 +distro==1.9.0 # via orb-billing -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -45,25 +45,26 @@ httpx==0.28.1 # via orb-billing httpx-aiohttp==0.1.9 # via orb-billing -idna==3.4 +idna==3.11 # via anyio # via httpx # via yarl -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl pydantic==2.12.5 # via orb-billing pydantic-core==2.41.5 # via pydantic -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via orb-billing typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via multidict # via orb-billing # via pydantic @@ -71,5 +72,5 @@ typing-extensions==4.15.0 # via typing-inspection typing-inspection==0.4.2 # via pydantic -yarl==1.20.0 +yarl==1.22.0 # via aiohttp diff --git a/src/orb/_version.py b/src/orb/_version.py index a44cccf0..0dc31380 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "orb" -__version__ = "4.44.0" # x-release-please-version +__version__ = "4.45.0" # x-release-please-version diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index 4c82a67f..721b6424 100644 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -103,6 +103,7 @@ def create( external_customer_id: Optional[str] | Omit = omit, hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, + payment_configuration: Optional[customer_create_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -166,6 +167,9 @@ def create( by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp. @@ -348,6 +352,7 @@ def create( "external_customer_id": external_customer_id, "hierarchy": hierarchy, "metadata": metadata, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -384,6 +389,7 @@ def update( hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, name: Optional[str] | Omit = omit, + payment_configuration: Optional[customer_update_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -439,6 +445,9 @@ def update( name: The full name of the customer + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -623,6 +632,7 @@ def update( "hierarchy": hierarchy, "metadata": metadata, "name": name, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -944,6 +954,7 @@ def update_by_external_id( hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, name: Optional[str] | Omit = omit, + payment_configuration: Optional[customer_update_by_external_id_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -998,6 +1009,9 @@ def update_by_external_id( name: The full name of the customer + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -1182,6 +1196,7 @@ def update_by_external_id( "hierarchy": hierarchy, "metadata": metadata, "name": name, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -1249,6 +1264,7 @@ async def create( external_customer_id: Optional[str] | Omit = omit, hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, + payment_configuration: Optional[customer_create_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -1312,6 +1328,9 @@ async def create( by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp. @@ -1494,6 +1513,7 @@ async def create( "external_customer_id": external_customer_id, "hierarchy": hierarchy, "metadata": metadata, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -1530,6 +1550,7 @@ async def update( hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, name: Optional[str] | Omit = omit, + payment_configuration: Optional[customer_update_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -1585,6 +1606,9 @@ async def update( name: The full name of the customer + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -1769,6 +1793,7 @@ async def update( "hierarchy": hierarchy, "metadata": metadata, "name": name, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -2090,6 +2115,7 @@ async def update_by_external_id( hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, name: Optional[str] | Omit = omit, + payment_configuration: Optional[customer_update_by_external_id_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -2144,6 +2170,9 @@ async def update_by_external_id( name: The full name of the customer + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -2328,6 +2357,7 @@ async def update_by_external_id( "hierarchy": hierarchy, "metadata": metadata, "name": name, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, diff --git a/src/orb/types/customer.py b/src/orb/types/customer.py index af140d3b..a0849c85 100644 --- a/src/orb/types/customer.py +++ b/src/orb/types/customer.py @@ -14,6 +14,8 @@ "Hierarchy", "AccountingSyncConfiguration", "AccountingSyncConfigurationAccountingProvider", + "PaymentConfiguration", + "PaymentConfigurationPaymentProvider", "ReportingConfiguration", ] @@ -36,6 +38,25 @@ class AccountingSyncConfiguration(BaseModel): excluded: bool +class PaymentConfigurationPaymentProvider(BaseModel): + provider_type: Literal["stripe"] + """The payment provider to configure.""" + + excluded_payment_method_types: Optional[List[str]] = None + """List of Stripe payment method types to exclude for this customer. + + Excluded payment methods will not be available for the customer to select during + payment, and will not be used for auto-collection. If a customer's default + payment method becomes excluded, Orb will attempt to use the next available + compatible payment method for auto-collection. + """ + + +class PaymentConfiguration(BaseModel): + payment_providers: Optional[List[PaymentConfigurationPaymentProvider]] = None + """Provider-specific payment configuration.""" + + class ReportingConfiguration(BaseModel): exempt: bool @@ -276,4 +297,10 @@ class Customer(BaseModel): boolean value. """ + payment_configuration: Optional[PaymentConfiguration] = None + """ + Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + """ + reporting_configuration: Optional[ReportingConfiguration] = None diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py index beb6ca60..1086c7cc 100644 --- a/src/orb/types/customer_create_params.py +++ b/src/orb/types/customer_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .._types import SequenceNotStr @@ -17,6 +17,8 @@ __all__ = [ "CustomerCreateParams", + "PaymentConfiguration", + "PaymentConfigurationPaymentProvider", "TaxConfiguration", "TaxConfigurationNewNumeralConfiguration", "TaxConfigurationNewAnrokConfiguration", @@ -87,6 +89,12 @@ class CustomerCreateParams(TypedDict, total=False): metadata mapping can be cleared by setting `metadata` to `null`. """ + payment_configuration: Optional[PaymentConfiguration] + """ + Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + """ + payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] """This is used for creating charges or invoices in an external system via Orb. @@ -262,6 +270,25 @@ class CustomerCreateParams(TypedDict, total=False): """ +class PaymentConfigurationPaymentProvider(TypedDict, total=False): + provider_type: Required[Literal["stripe"]] + """The payment provider to configure.""" + + excluded_payment_method_types: SequenceNotStr[str] + """List of Stripe payment method types to exclude for this customer. + + Excluded payment methods will not be available for the customer to select during + payment, and will not be used for auto-collection. If a customer's default + payment method becomes excluded, Orb will attempt to use the next available + compatible payment method for auto-collection. + """ + + +class PaymentConfiguration(TypedDict, total=False): + payment_providers: Iterable[PaymentConfigurationPaymentProvider] + """Provider-specific payment configuration.""" + + class TaxConfigurationNewNumeralConfiguration(TypedDict, total=False): tax_exempt: Required[bool] diff --git a/src/orb/types/customer_update_by_external_id_params.py b/src/orb/types/customer_update_by_external_id_params.py index 1738846a..7ff55d1d 100644 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .._types import SequenceNotStr @@ -17,6 +17,8 @@ __all__ = [ "CustomerUpdateByExternalIDParams", + "PaymentConfiguration", + "PaymentConfigurationPaymentProvider", "TaxConfiguration", "TaxConfigurationNewNumeralConfiguration", "TaxConfigurationNewAnrokConfiguration", @@ -85,6 +87,12 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): name: Optional[str] """The full name of the customer""" + payment_configuration: Optional[PaymentConfiguration] + """ + Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + """ + payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] """This is used for creating charges or invoices in an external system via Orb. @@ -257,6 +265,25 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): """ +class PaymentConfigurationPaymentProvider(TypedDict, total=False): + provider_type: Required[Literal["stripe"]] + """The payment provider to configure.""" + + excluded_payment_method_types: SequenceNotStr[str] + """List of Stripe payment method types to exclude for this customer. + + Excluded payment methods will not be available for the customer to select during + payment, and will not be used for auto-collection. If a customer's default + payment method becomes excluded, Orb will attempt to use the next available + compatible payment method for auto-collection. + """ + + +class PaymentConfiguration(TypedDict, total=False): + payment_providers: Iterable[PaymentConfigurationPaymentProvider] + """Provider-specific payment configuration.""" + + class TaxConfigurationNewNumeralConfiguration(TypedDict, total=False): tax_exempt: Required[bool] diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index af9e86cb..be75c0a7 100644 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .._types import SequenceNotStr @@ -17,6 +17,8 @@ __all__ = [ "CustomerUpdateParams", + "PaymentConfiguration", + "PaymentConfigurationPaymentProvider", "TaxConfiguration", "TaxConfigurationNewNumeralConfiguration", "TaxConfigurationNewAnrokConfiguration", @@ -85,6 +87,12 @@ class CustomerUpdateParams(TypedDict, total=False): name: Optional[str] """The full name of the customer""" + payment_configuration: Optional[PaymentConfiguration] + """ + Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + """ + payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] """This is used for creating charges or invoices in an external system via Orb. @@ -257,6 +265,25 @@ class CustomerUpdateParams(TypedDict, total=False): """ +class PaymentConfigurationPaymentProvider(TypedDict, total=False): + provider_type: Required[Literal["stripe"]] + """The payment provider to configure.""" + + excluded_payment_method_types: SequenceNotStr[str] + """List of Stripe payment method types to exclude for this customer. + + Excluded payment methods will not be available for the customer to select during + payment, and will not be used for auto-collection. If a customer's default + payment method becomes excluded, Orb will attempt to use the next available + compatible payment method for auto-collection. + """ + + +class PaymentConfiguration(TypedDict, total=False): + payment_providers: Iterable[PaymentConfigurationPaymentProvider] + """Provider-specific payment configuration.""" + + class TaxConfigurationNewNumeralConfiguration(TypedDict, total=False): tax_exempt: Required[bool] diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 71050420..99212e34 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -62,6 +62,14 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "parent_customer_id": "parent_customer_id", }, metadata={"foo": "string"}, + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -155,6 +163,14 @@ def test_method_update_with_all_params(self, client: Orb) -> None: }, metadata={"foo": "string"}, name="name", + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -479,6 +495,14 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None }, metadata={"foo": "string"}, name="name", + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -582,6 +606,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "parent_customer_id": "parent_customer_id", }, metadata={"foo": "string"}, + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -675,6 +707,14 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No }, metadata={"foo": "string"}, name="name", + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -1011,6 +1051,14 @@ async def test_method_update_by_external_id_with_all_params(self, async_client: }, metadata={"foo": "string"}, name="name", + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True},