From 7fe2329a46fcbe7cbbfcebc32d5ba748db02d01d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 20:02:33 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +-- .../resources/simulations/card_refunds.py | 30 +++++++++++++++---- .../simulations/card_refund_create_params.py | 11 +++++-- .../simulations/test_card_refunds.py | 28 +++++++++-------- 4 files changed, 52 insertions(+), 21 deletions(-) diff --git a/.stats.yml b/.stats.yml index a9120ac7b..d034046d8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 214 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-749004bde06df3642fccde727f8e872c02795128db180789d1377c3168bd71ba.yml -openapi_spec_hash: 9058f9b3951c7608de5b67d8d5c87ffd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-c51555226fd66ed304eb1e9c759a6485c071eb2cb9ca9ee86f5b5cd88552ee4a.yml +openapi_spec_hash: c5b09ec531c068cb675f8cd3729733c6 config_hash: a143293c5450ae8f52acad08f3102575 diff --git a/src/increase/resources/simulations/card_refunds.py b/src/increase/resources/simulations/card_refunds.py index 597d864b5..a233eed0a 100644 --- a/src/increase/resources/simulations/card_refunds.py +++ b/src/increase/resources/simulations/card_refunds.py @@ -4,7 +4,7 @@ import httpx -from ..._types import Body, Query, Headers, NotGiven, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -44,7 +44,8 @@ def with_streaming_response(self) -> CardRefundsResourceWithStreamingResponse: def create( self, *, - transaction_id: str, + pending_transaction_id: str | Omit = omit, + transaction_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -59,6 +60,10 @@ def create( transaction is refunded. Args: + pending_transaction_id: The identifier of the Pending Transaction for the refund authorization. If this + is provided, `transaction` must not be provided as a refund with a refund + authorized can not be linked to a regular transaction. + transaction_id: The identifier for the Transaction to refund. The Transaction's source must have a category of card_settlement. @@ -74,7 +79,13 @@ def create( """ return self._post( "/simulations/card_refunds", - body=maybe_transform({"transaction_id": transaction_id}, card_refund_create_params.CardRefundCreateParams), + body=maybe_transform( + { + "pending_transaction_id": pending_transaction_id, + "transaction_id": transaction_id, + }, + card_refund_create_params.CardRefundCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -109,7 +120,8 @@ def with_streaming_response(self) -> AsyncCardRefundsResourceWithStreamingRespon async def create( self, *, - transaction_id: str, + pending_transaction_id: str | Omit = omit, + transaction_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -124,6 +136,10 @@ async def create( transaction is refunded. Args: + pending_transaction_id: The identifier of the Pending Transaction for the refund authorization. If this + is provided, `transaction` must not be provided as a refund with a refund + authorized can not be linked to a regular transaction. + transaction_id: The identifier for the Transaction to refund. The Transaction's source must have a category of card_settlement. @@ -140,7 +156,11 @@ async def create( return await self._post( "/simulations/card_refunds", body=await async_maybe_transform( - {"transaction_id": transaction_id}, card_refund_create_params.CardRefundCreateParams + { + "pending_transaction_id": pending_transaction_id, + "transaction_id": transaction_id, + }, + card_refund_create_params.CardRefundCreateParams, ), options=make_request_options( extra_headers=extra_headers, diff --git a/src/increase/types/simulations/card_refund_create_params.py b/src/increase/types/simulations/card_refund_create_params.py index fb072b9c0..da0c4704a 100644 --- a/src/increase/types/simulations/card_refund_create_params.py +++ b/src/increase/types/simulations/card_refund_create_params.py @@ -2,13 +2,20 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["CardRefundCreateParams"] class CardRefundCreateParams(TypedDict, total=False): - transaction_id: Required[str] + pending_transaction_id: str + """The identifier of the Pending Transaction for the refund authorization. + + If this is provided, `transaction` must not be provided as a refund with a + refund authorized can not be linked to a regular transaction. + """ + + transaction_id: str """The identifier for the Transaction to refund. The Transaction's source must have a category of card_settlement. diff --git a/tests/api_resources/simulations/test_card_refunds.py b/tests/api_resources/simulations/test_card_refunds.py index 07bb1bb8d..36b239d51 100644 --- a/tests/api_resources/simulations/test_card_refunds.py +++ b/tests/api_resources/simulations/test_card_refunds.py @@ -19,16 +19,20 @@ class TestCardRefunds: @parametrize def test_method_create(self, client: Increase) -> None: + card_refund = client.simulations.card_refunds.create() + assert_matches_type(Transaction, card_refund, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Increase) -> None: card_refund = client.simulations.card_refunds.create( + pending_transaction_id="pending_transaction_id", transaction_id="transaction_uyrp7fld2ium70oa7oi", ) assert_matches_type(Transaction, card_refund, path=["response"]) @parametrize def test_raw_response_create(self, client: Increase) -> None: - response = client.simulations.card_refunds.with_raw_response.create( - transaction_id="transaction_uyrp7fld2ium70oa7oi", - ) + response = client.simulations.card_refunds.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -37,9 +41,7 @@ def test_raw_response_create(self, client: Increase) -> None: @parametrize def test_streaming_response_create(self, client: Increase) -> None: - with client.simulations.card_refunds.with_streaming_response.create( - transaction_id="transaction_uyrp7fld2ium70oa7oi", - ) as response: + with client.simulations.card_refunds.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -56,16 +58,20 @@ class TestAsyncCardRefunds: @parametrize async def test_method_create(self, async_client: AsyncIncrease) -> None: + card_refund = await async_client.simulations.card_refunds.create() + assert_matches_type(Transaction, card_refund, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncIncrease) -> None: card_refund = await async_client.simulations.card_refunds.create( + pending_transaction_id="pending_transaction_id", transaction_id="transaction_uyrp7fld2ium70oa7oi", ) assert_matches_type(Transaction, card_refund, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncIncrease) -> None: - response = await async_client.simulations.card_refunds.with_raw_response.create( - transaction_id="transaction_uyrp7fld2ium70oa7oi", - ) + response = await async_client.simulations.card_refunds.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -74,9 +80,7 @@ async def test_raw_response_create(self, async_client: AsyncIncrease) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncIncrease) -> None: - async with async_client.simulations.card_refunds.with_streaming_response.create( - transaction_id="transaction_uyrp7fld2ium70oa7oi", - ) as response: + async with async_client.simulations.card_refunds.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" From adc300d7fb15602b1fb74db366123f42c1a795b0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 20:02:54 +0000 Subject: [PATCH 2/2] release: 0.342.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7951156ff..d246629db 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.341.0" + ".": "0.342.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 32f1bffa2..b13f0480d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.342.0 (2025-09-26) + +Full Changelog: [v0.341.0...v0.342.0](https://github.com/Increase/increase-python/compare/v0.341.0...v0.342.0) + +### Features + +* **api:** api update ([7fe2329](https://github.com/Increase/increase-python/commit/7fe2329a46fcbe7cbbfcebc32d5ba748db02d01d)) + ## 0.341.0 (2025-09-26) Full Changelog: [v0.340.0...v0.341.0](https://github.com/Increase/increase-python/compare/v0.340.0...v0.341.0) diff --git a/pyproject.toml b/pyproject.toml index 010887a97..4af5612f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.341.0" +version = "0.342.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 d5fad0193..2c4802851 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.341.0" # x-release-please-version +__version__ = "0.342.0" # x-release-please-version