diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 620f306a1..f7e28725e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.190.0" + ".": "0.191.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 94aeca296..32dd62903 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 201 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-5e0974f81d8dea4e99659c75d479605f1661bcd04e3c22722f451bba180b308a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b3b6572700500a421109ac83ef56b3046e9f1510ca7d1f583d329d1b8ecf5516.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index d6159927c..2dc8759dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.191.0 (2025-02-12) + +Full Changelog: [v0.190.0...v0.191.0](https://github.com/Increase/increase-python/compare/v0.190.0...v0.191.0) + +### Features + +* **api:** api update ([#967](https://github.com/Increase/increase-python/issues/967)) ([d451149](https://github.com/Increase/increase-python/commit/d451149b25fbc96abe741b37fa53660e2580d0d3)) + + +### Chores + +* **internal:** update client tests ([#965](https://github.com/Increase/increase-python/issues/965)) ([90021f2](https://github.com/Increase/increase-python/commit/90021f217d112066dc15d0291ba9d6e300de2cf3)) + ## 0.190.0 (2025-02-11) Full Changelog: [v0.189.0...v0.190.0](https://github.com/Increase/increase-python/compare/v0.189.0...v0.190.0) diff --git a/pyproject.toml b/pyproject.toml index 323087440..6d42c6a56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.190.0" +version = "0.191.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_version.py b/src/increase/_version.py index 35da20e88..d76519f0f 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.190.0" # x-release-please-version +__version__ = "0.191.0" # x-release-please-version diff --git a/src/increase/resources/simulations/card_authorizations.py b/src/increase/resources/simulations/card_authorizations.py index a1f07895d..a7e8f0413 100644 --- a/src/increase/resources/simulations/card_authorizations.py +++ b/src/increase/resources/simulations/card_authorizations.py @@ -79,6 +79,7 @@ def create( merchant_country: str | NotGiven = NOT_GIVEN, merchant_descriptor: str | NotGiven = NOT_GIVEN, merchant_state: str | NotGiven = NOT_GIVEN, + network_details: card_authorization_create_params.NetworkDetails | NotGiven = NOT_GIVEN, physical_card_id: str | NotGiven = NOT_GIVEN, terminal_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -162,6 +163,8 @@ def create( merchant_state: The state the merchant resides in. + network_details: Fields specific to a given card network. + physical_card_id: The identifier of the Physical Card to be authorized. terminal_id: The terminal identifier (commonly abbreviated as TID) of the terminal the card @@ -194,6 +197,7 @@ def create( "merchant_country": merchant_country, "merchant_descriptor": merchant_descriptor, "merchant_state": merchant_state, + "network_details": network_details, "physical_card_id": physical_card_id, "terminal_id": terminal_id, }, @@ -263,6 +267,7 @@ async def create( merchant_country: str | NotGiven = NOT_GIVEN, merchant_descriptor: str | NotGiven = NOT_GIVEN, merchant_state: str | NotGiven = NOT_GIVEN, + network_details: card_authorization_create_params.NetworkDetails | NotGiven = NOT_GIVEN, physical_card_id: str | NotGiven = NOT_GIVEN, terminal_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -346,6 +351,8 @@ async def create( merchant_state: The state the merchant resides in. + network_details: Fields specific to a given card network. + physical_card_id: The identifier of the Physical Card to be authorized. terminal_id: The terminal identifier (commonly abbreviated as TID) of the terminal the card @@ -378,6 +385,7 @@ async def create( "merchant_country": merchant_country, "merchant_descriptor": merchant_descriptor, "merchant_state": merchant_state, + "network_details": network_details, "physical_card_id": physical_card_id, "terminal_id": terminal_id, }, diff --git a/src/increase/types/simulations/card_authorization_create_params.py b/src/increase/types/simulations/card_authorization_create_params.py index 35b5110cd..9232f0e10 100644 --- a/src/increase/types/simulations/card_authorization_create_params.py +++ b/src/increase/types/simulations/card_authorization_create_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["CardAuthorizationCreateParams"] +__all__ = ["CardAuthorizationCreateParams", "NetworkDetails", "NetworkDetailsVisa"] class CardAuthorizationCreateParams(TypedDict, total=False): @@ -111,6 +111,9 @@ class CardAuthorizationCreateParams(TypedDict, total=False): merchant_state: str """The state the merchant resides in.""" + network_details: NetworkDetails + """Fields specific to a given card network.""" + physical_card_id: str """The identifier of the Physical Card to be authorized.""" @@ -119,3 +122,40 @@ class CardAuthorizationCreateParams(TypedDict, total=False): The terminal identifier (commonly abbreviated as TID) of the terminal the card is transacting with. """ + + +class NetworkDetailsVisa(TypedDict, total=False): + stand_in_processing_reason: Literal[ + "issuer_error", + "invalid_physical_card", + "invalid_cardholder_authentication_verification_value", + "internal_visa_error", + "merchant_transaction_advisory_service_authentication_required", + "payment_fraud_disruption_acquirer_block", + "other", + ] + """The reason code for the stand-in processing. + + - `issuer_error` - Increase failed to process the authorization in a timely + manner. + - `invalid_physical_card` - The physical card read had an invalid CVV, dCVV, or + authorization request cryptogram. + - `invalid_cardholder_authentication_verification_value` - The 3DS cardholder + authentication verification value was invalid. + - `internal_visa_error` - An internal Visa error occurred. Visa uses this reason + code for certain expected occurrences as well, such as Application Transaction + Counter (ATC) replays. + - `merchant_transaction_advisory_service_authentication_required` - The merchant + has enabled Visa's Transaction Advisory Service and requires further + authentication to perform the transaction. In practice this is often utilized + at fuel pumps to tell the cardholder to see the cashier. + - `payment_fraud_disruption_acquirer_block` - The transaction was blocked by + Visa's Payment Fraud Disruption service due to fraudulent Acquirer behavior, + such as card testing. + - `other` - An unspecific reason for stand-in processing. + """ + + +class NetworkDetails(TypedDict, total=False): + visa: Required[NetworkDetailsVisa] + """Fields specific to the Visa network.""" diff --git a/tests/api_resources/simulations/test_card_authorizations.py b/tests/api_resources/simulations/test_card_authorizations.py index eb77386fc..eddb63f32 100644 --- a/tests/api_resources/simulations/test_card_authorizations.py +++ b/tests/api_resources/simulations/test_card_authorizations.py @@ -40,6 +40,7 @@ def test_method_create_with_all_params(self, client: Increase) -> None: merchant_country="US", merchant_descriptor="AMAZON.COM", merchant_state="NY", + network_details={"visa": {"stand_in_processing_reason": "issuer_error"}}, physical_card_id="physical_card_id", terminal_id="x", ) @@ -96,6 +97,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIncrease) merchant_country="US", merchant_descriptor="AMAZON.COM", merchant_state="NY", + network_details={"visa": {"stand_in_processing_reason": "issuer_error"}}, physical_card_id="physical_card_id", terminal_id="x", ) diff --git a/tests/test_client.py b/tests/test_client.py index d4228a6a8..b5ea44f9a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -23,6 +23,7 @@ from increase import Increase, AsyncIncrease, APIResponseValidationError from increase._types import Omit +from increase._utils import maybe_transform from increase._models import BaseModel, FinalRequestOptions from increase._constants import RAW_RESPONSE_HEADER from increase._exceptions import IncreaseError, APIStatusError, APITimeoutError, APIResponseValidationError @@ -32,6 +33,7 @@ BaseClient, make_request_options, ) +from increase.types.account_create_params import AccountCreateParams from .utils import update_env @@ -760,10 +762,13 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No "/accounts", body=cast( object, - dict( - name="New Account!", - entity_id="entity_n8y8tnk2p9339ti393yi", - program_id="program_i2v2os4mwza1oetokh9i", + maybe_transform( + dict( + name="New Account!", + entity_id="entity_n8y8tnk2p9339ti393yi", + program_id="program_i2v2os4mwza1oetokh9i", + ), + AccountCreateParams, ), ), cast_to=httpx.Response, @@ -782,10 +787,13 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non "/accounts", body=cast( object, - dict( - name="New Account!", - entity_id="entity_n8y8tnk2p9339ti393yi", - program_id="program_i2v2os4mwza1oetokh9i", + maybe_transform( + dict( + name="New Account!", + entity_id="entity_n8y8tnk2p9339ti393yi", + program_id="program_i2v2os4mwza1oetokh9i", + ), + AccountCreateParams, ), ), cast_to=httpx.Response, @@ -1595,10 +1603,13 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) "/accounts", body=cast( object, - dict( - name="New Account!", - entity_id="entity_n8y8tnk2p9339ti393yi", - program_id="program_i2v2os4mwza1oetokh9i", + maybe_transform( + dict( + name="New Account!", + entity_id="entity_n8y8tnk2p9339ti393yi", + program_id="program_i2v2os4mwza1oetokh9i", + ), + AccountCreateParams, ), ), cast_to=httpx.Response, @@ -1617,10 +1628,13 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) "/accounts", body=cast( object, - dict( - name="New Account!", - entity_id="entity_n8y8tnk2p9339ti393yi", - program_id="program_i2v2os4mwza1oetokh9i", + maybe_transform( + dict( + name="New Account!", + entity_id="entity_n8y8tnk2p9339ti393yi", + program_id="program_i2v2os4mwza1oetokh9i", + ), + AccountCreateParams, ), ), cast_to=httpx.Response,