From 4638890429ad2615ccc1d55de2819cf20c4b0444 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:06:33 +0000 Subject: [PATCH 1/4] chore: rebuild project due to codegen change (#795) --- tests/test_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 951e3382..98d80853 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -734,7 +734,7 @@ class Model(BaseModel): [3, "", 0.5], [2, "", 0.5 * 2.0], [1, "", 0.5 * 4.0], - [-1100, "", 7.8], # test large number potentially overflowing + [-1100, "", 8], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -1568,7 +1568,7 @@ class Model(BaseModel): [3, "", 0.5], [2, "", 0.5 * 2.0], [1, "", 0.5 * 4.0], - [-1100, "", 7.8], # test large number potentially overflowing + [-1100, "", 8], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) From 81d3a2569114e85a2ffef79d7f09484c483cb9ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 23:08:28 +0000 Subject: [PATCH 2/4] chore: rebuild project due to codegen change (#797) --- .stats.yml | 2 +- .../resources/simulations/card_disputes.py | 8 ++++++-- src/increase/types/card_dispute.py | 4 +++- .../types/card_dispute_list_params.py | 2 +- .../simulations/card_dispute_action_params.py | 4 +++- .../simulations/test_card_disputes.py | 20 +++++++++---------- tests/api_resources/test_card_disputes.py | 4 ++-- 7 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2506ce30..af3caaa4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 199 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-586f9c0ac14d8018b5664ba7f2a10c3838087238ca1880fe074e9234e37ceea6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b0e4d84104c5ecacb5abc28a2902ca45a7406ea1981463f625aecfd447b330ee.yml diff --git a/src/increase/resources/simulations/card_disputes.py b/src/increase/resources/simulations/card_disputes.py index 139de12e..2adbb400 100644 --- a/src/increase/resources/simulations/card_disputes.py +++ b/src/increase/resources/simulations/card_disputes.py @@ -50,7 +50,7 @@ def action( self, card_dispute_id: str, *, - status: Literal["accepted", "rejected", "lost", "won"], + status: Literal["pending_user_information", "accepted", "rejected", "lost", "won"], explanation: str | NotGiven = NOT_GIVEN, # 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. @@ -71,6 +71,8 @@ def action( status: The status to move the dispute to. + - `pending_user_information` - Increase has requested more information related + to the Card Dispute from you. - `accepted` - The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. @@ -137,7 +139,7 @@ async def action( self, card_dispute_id: str, *, - status: Literal["accepted", "rejected", "lost", "won"], + status: Literal["pending_user_information", "accepted", "rejected", "lost", "won"], explanation: str | NotGiven = NOT_GIVEN, # 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. @@ -158,6 +160,8 @@ async def action( status: The status to move the dispute to. + - `pending_user_information` - Increase has requested more information related + to the Card Dispute from you. - `accepted` - The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. diff --git a/src/increase/types/card_dispute.py b/src/increase/types/card_dispute.py index 9b406a88..249bb0d8 100644 --- a/src/increase/types/card_dispute.py +++ b/src/increase/types/card_dispute.py @@ -116,10 +116,12 @@ class CardDispute(BaseModel): unsuccessful dispute. """ - status: Literal["pending_reviewing", "accepted", "rejected", "lost", "won"] + status: Literal["pending_reviewing", "pending_user_information", "accepted", "rejected", "lost", "won"] """The results of the Dispute investigation. - `pending_reviewing` - The Card Dispute is pending review. + - `pending_user_information` - Increase has requested more information related + to the Card Dispute from you. - `accepted` - The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. diff --git a/src/increase/types/card_dispute_list_params.py b/src/increase/types/card_dispute_list_params.py index 8901f8d4..73e384bd 100644 --- a/src/increase/types/card_dispute_list_params.py +++ b/src/increase/types/card_dispute_list_params.py @@ -63,7 +63,7 @@ class CreatedAt(TypedDict, total=False): _StatusReservedKeywords = TypedDict( "_StatusReservedKeywords", { - "in": List[Literal["pending_reviewing", "accepted", "rejected", "lost", "won"]], + "in": List[Literal["pending_reviewing", "pending_user_information", "accepted", "rejected", "lost", "won"]], }, total=False, ) diff --git a/src/increase/types/simulations/card_dispute_action_params.py b/src/increase/types/simulations/card_dispute_action_params.py index 4c7375f2..eaf7cbed 100644 --- a/src/increase/types/simulations/card_dispute_action_params.py +++ b/src/increase/types/simulations/card_dispute_action_params.py @@ -8,9 +8,11 @@ class CardDisputeActionParams(TypedDict, total=False): - status: Required[Literal["accepted", "rejected", "lost", "won"]] + status: Required[Literal["pending_user_information", "accepted", "rejected", "lost", "won"]] """The status to move the dispute to. + - `pending_user_information` - Increase has requested more information related + to the Card Dispute from you. - `accepted` - The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. diff --git a/tests/api_resources/simulations/test_card_disputes.py b/tests/api_resources/simulations/test_card_disputes.py index 25d1d3f6..b7b4e263 100644 --- a/tests/api_resources/simulations/test_card_disputes.py +++ b/tests/api_resources/simulations/test_card_disputes.py @@ -21,7 +21,7 @@ class TestCardDisputes: def test_method_action(self, client: Increase) -> None: card_dispute = client.simulations.card_disputes.action( card_dispute_id="card_dispute_h9sc95nbl1cgltpp7men", - status="accepted", + status="pending_user_information", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) @@ -29,7 +29,7 @@ def test_method_action(self, client: Increase) -> None: def test_method_action_with_all_params(self, client: Increase) -> None: card_dispute = client.simulations.card_disputes.action( card_dispute_id="card_dispute_h9sc95nbl1cgltpp7men", - status="accepted", + status="pending_user_information", explanation="This was a valid recurring transaction", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) @@ -38,7 +38,7 @@ def test_method_action_with_all_params(self, client: Increase) -> None: def test_raw_response_action(self, client: Increase) -> None: response = client.simulations.card_disputes.with_raw_response.action( card_dispute_id="card_dispute_h9sc95nbl1cgltpp7men", - status="accepted", + status="pending_user_information", ) assert response.is_closed is True @@ -50,7 +50,7 @@ def test_raw_response_action(self, client: Increase) -> None: def test_streaming_response_action(self, client: Increase) -> None: with client.simulations.card_disputes.with_streaming_response.action( card_dispute_id="card_dispute_h9sc95nbl1cgltpp7men", - status="accepted", + status="pending_user_information", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -65,7 +65,7 @@ def test_path_params_action(self, client: Increase) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `card_dispute_id` but received ''"): client.simulations.card_disputes.with_raw_response.action( card_dispute_id="", - status="accepted", + status="pending_user_information", ) @@ -76,7 +76,7 @@ class TestAsyncCardDisputes: async def test_method_action(self, async_client: AsyncIncrease) -> None: card_dispute = await async_client.simulations.card_disputes.action( card_dispute_id="card_dispute_h9sc95nbl1cgltpp7men", - status="accepted", + status="pending_user_information", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) @@ -84,7 +84,7 @@ async def test_method_action(self, async_client: AsyncIncrease) -> None: async def test_method_action_with_all_params(self, async_client: AsyncIncrease) -> None: card_dispute = await async_client.simulations.card_disputes.action( card_dispute_id="card_dispute_h9sc95nbl1cgltpp7men", - status="accepted", + status="pending_user_information", explanation="This was a valid recurring transaction", ) assert_matches_type(CardDispute, card_dispute, path=["response"]) @@ -93,7 +93,7 @@ async def test_method_action_with_all_params(self, async_client: AsyncIncrease) async def test_raw_response_action(self, async_client: AsyncIncrease) -> None: response = await async_client.simulations.card_disputes.with_raw_response.action( card_dispute_id="card_dispute_h9sc95nbl1cgltpp7men", - status="accepted", + status="pending_user_information", ) assert response.is_closed is True @@ -105,7 +105,7 @@ async def test_raw_response_action(self, async_client: AsyncIncrease) -> None: async def test_streaming_response_action(self, async_client: AsyncIncrease) -> None: async with async_client.simulations.card_disputes.with_streaming_response.action( card_dispute_id="card_dispute_h9sc95nbl1cgltpp7men", - status="accepted", + status="pending_user_information", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -120,5 +120,5 @@ async def test_path_params_action(self, async_client: AsyncIncrease) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `card_dispute_id` but received ''"): await async_client.simulations.card_disputes.with_raw_response.action( card_dispute_id="", - status="accepted", + status="pending_user_information", ) diff --git a/tests/api_resources/test_card_disputes.py b/tests/api_resources/test_card_disputes.py index a8ff27e7..47160847 100644 --- a/tests/api_resources/test_card_disputes.py +++ b/tests/api_resources/test_card_disputes.py @@ -117,7 +117,7 @@ def test_method_list_with_all_params(self, client: Increase) -> None: cursor="cursor", idempotency_key="x", limit=1, - status={"in": ["pending_reviewing", "accepted", "rejected"]}, + status={"in": ["pending_reviewing", "pending_user_information", "accepted"]}, ) assert_matches_type(SyncPage[CardDispute], card_dispute, path=["response"]) @@ -243,7 +243,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncIncrease) -> cursor="cursor", idempotency_key="x", limit=1, - status={"in": ["pending_reviewing", "accepted", "rejected"]}, + status={"in": ["pending_reviewing", "pending_user_information", "accepted"]}, ) assert_matches_type(AsyncPage[CardDispute], card_dispute, path=["response"]) From a79225b0650339a5ba4549523051f600769e43aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 04:56:01 +0000 Subject: [PATCH 3/4] feat(api): api update (#798) --- .stats.yml | 2 +- .../simulations/card_authorizations.py | 10 ++++++++ src/increase/types/card_payment.py | 24 +++++++++++++++++++ src/increase/types/declined_transaction.py | 6 +++++ src/increase/types/pending_transaction.py | 6 +++++ src/increase/types/real_time_decision.py | 6 +++++ .../card_authorization_create_params.py | 6 +++++ .../simulations/test_card_authorizations.py | 2 ++ 8 files changed, 61 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index af3caaa4..5bdcebc5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 199 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b0e4d84104c5ecacb5abc28a2902ca45a7406ea1981463f625aecfd447b330ee.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-7bb6e334b298eabe597d7b87ffa9ace8fe16b38501ec6bcbfc3c6ea3a34c3435.yml diff --git a/src/increase/resources/simulations/card_authorizations.py b/src/increase/resources/simulations/card_authorizations.py index 15d8099d..9d58bb09 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, 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -160,6 +161,9 @@ def create( 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 + is transacting with. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -187,6 +191,7 @@ def create( "merchant_country": merchant_country, "merchant_descriptor": merchant_descriptor, "physical_card_id": physical_card_id, + "terminal_id": terminal_id, }, card_authorization_create_params.CardAuthorizationCreateParams, ), @@ -254,6 +259,7 @@ async def create( merchant_country: str | NotGiven = NOT_GIVEN, merchant_descriptor: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -335,6 +341,9 @@ async def create( 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 + is transacting with. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -362,6 +371,7 @@ async def create( "merchant_country": merchant_country, "merchant_descriptor": merchant_descriptor, "physical_card_id": physical_card_id, + "terminal_id": terminal_id, }, card_authorization_create_params.CardAuthorizationCreateParams, ), diff --git a/src/increase/types/card_payment.py b/src/increase/types/card_payment.py index b7dbce04..d69a2b97 100644 --- a/src/increase/types/card_payment.py +++ b/src/increase/types/card_payment.py @@ -419,6 +419,12 @@ class ElementCardAuthorization(BaseModel): transaction. """ + terminal_id: Optional[str] = None + """ + The terminal identifier (commonly abbreviated as TID) of the terminal the card + is transacting with. + """ + type: Literal["card_authorization"] """A constant representing the object's type. @@ -865,6 +871,12 @@ class ElementCardDecline(BaseModel): reach out to support@increase.com for more information. """ + terminal_id: Optional[str] = None + """ + The terminal identifier (commonly abbreviated as TID) of the terminal the card + is transacting with. + """ + verification: ElementCardDeclineVerification """Fields related to verification of cardholder-provided values.""" @@ -1667,6 +1679,12 @@ class ElementCardReversal(BaseModel): - `partial_reversal` - The Card Reversal was a partial reversal, for any reason. """ + terminal_id: Optional[str] = None + """ + The terminal identifier (commonly abbreviated as TID) of the terminal the card + is transacting with. + """ + type: Literal["card_reversal"] """A constant representing the object's type. @@ -2518,6 +2536,12 @@ class ElementCardValidation(BaseModel): transaction. """ + terminal_id: Optional[str] = None + """ + The terminal identifier (commonly abbreviated as TID) of the terminal the card + is transacting with. + """ + type: Literal["card_validation"] """A constant representing the object's type. diff --git a/src/increase/types/declined_transaction.py b/src/increase/types/declined_transaction.py index 4c2cfb63..c4390c73 100644 --- a/src/increase/types/declined_transaction.py +++ b/src/increase/types/declined_transaction.py @@ -508,6 +508,12 @@ class SourceCardDecline(BaseModel): reach out to support@increase.com for more information. """ + terminal_id: Optional[str] = None + """ + The terminal identifier (commonly abbreviated as TID) of the terminal the card + is transacting with. + """ + verification: SourceCardDeclineVerification """Fields related to verification of cardholder-provided values.""" diff --git a/src/increase/types/pending_transaction.py b/src/increase/types/pending_transaction.py index 206f0011..59ac2e6e 100644 --- a/src/increase/types/pending_transaction.py +++ b/src/increase/types/pending_transaction.py @@ -416,6 +416,12 @@ class SourceCardAuthorization(BaseModel): transaction. """ + terminal_id: Optional[str] = None + """ + The terminal identifier (commonly abbreviated as TID) of the terminal the card + is transacting with. + """ + type: Literal["card_authorization"] """A constant representing the object's type. diff --git a/src/increase/types/real_time_decision.py b/src/increase/types/real_time_decision.py index b74077ff..96147179 100644 --- a/src/increase/types/real_time_decision.py +++ b/src/increase/types/real_time_decision.py @@ -441,6 +441,12 @@ class CardAuthorization(BaseModel): transaction will be settled in. """ + terminal_id: Optional[str] = None + """ + The terminal identifier (commonly abbreviated as TID) of the terminal the card + is transacting with. + """ + upcoming_card_payment_id: str """The identifier of the Card Payment this authorization will belong to. diff --git a/src/increase/types/simulations/card_authorization_create_params.py b/src/increase/types/simulations/card_authorization_create_params.py index f6e2b43e..386c89b3 100644 --- a/src/increase/types/simulations/card_authorization_create_params.py +++ b/src/increase/types/simulations/card_authorization_create_params.py @@ -110,3 +110,9 @@ class CardAuthorizationCreateParams(TypedDict, total=False): physical_card_id: str """The identifier of the Physical Card to be authorized.""" + + terminal_id: str + """ + The terminal identifier (commonly abbreviated as TID) of the terminal the card + is transacting with. + """ diff --git a/tests/api_resources/simulations/test_card_authorizations.py b/tests/api_resources/simulations/test_card_authorizations.py index d9186d6e..09ad8f19 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", physical_card_id="physical_card_id", + terminal_id="x", ) assert_matches_type(CardAuthorizationCreateResponse, card_authorization, path=["response"]) @@ -94,6 +95,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIncrease) merchant_country="US", merchant_descriptor="AMAZON.COM", physical_card_id="physical_card_id", + terminal_id="x", ) assert_matches_type(CardAuthorizationCreateResponse, card_authorization, path=["response"]) From ef08c2f3ad77665503cfe21b8f52d84a75c57d10 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 04:56:21 +0000 Subject: [PATCH 4/4] release: 0.151.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b56d745d..07c725da 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.150.0" + ".": "0.151.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d66cfca..c81f05f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.151.0 (2024-11-08) + +Full Changelog: [v0.150.0...v0.151.0](https://github.com/Increase/increase-python/compare/v0.150.0...v0.151.0) + +### Features + +* **api:** api update ([#798](https://github.com/Increase/increase-python/issues/798)) ([a79225b](https://github.com/Increase/increase-python/commit/a79225b0650339a5ba4549523051f600769e43aa)) + + +### Chores + +* rebuild project due to codegen change ([#795](https://github.com/Increase/increase-python/issues/795)) ([4638890](https://github.com/Increase/increase-python/commit/4638890429ad2615ccc1d55de2819cf20c4b0444)) +* rebuild project due to codegen change ([#797](https://github.com/Increase/increase-python/issues/797)) ([81d3a25](https://github.com/Increase/increase-python/commit/81d3a2569114e85a2ffef79d7f09484c483cb9ce)) + ## 0.150.0 (2024-11-05) Full Changelog: [v0.149.0...v0.150.0](https://github.com/Increase/increase-python/compare/v0.149.0...v0.150.0) diff --git a/pyproject.toml b/pyproject.toml index d1be5867..dac17294 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.150.0" +version = "0.151.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 a4f14db5..1ed71a67 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.150.0" # x-release-please-version +__version__ = "0.151.0" # x-release-please-version