Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.341.0"
".": "0.342.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/increase/_version.py
Original file line number Diff line number Diff line change
@@ -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
30 changes: 25 additions & 5 deletions src/increase/resources/simulations/card_refunds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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.

Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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.

Expand All @@ -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,
Expand Down
11 changes: 9 additions & 2 deletions src/increase/types/simulations/card_refund_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
28 changes: 16 additions & 12 deletions tests/api_resources/simulations/test_card_refunds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand All @@ -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"
Expand All @@ -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"

Expand Down