Skip to content

Commit fed517e

Browse files
feat(api): add payment transaction support to case transactions
1 parent c30702f commit fed517e

3 files changed

Lines changed: 37 additions & 9 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 213
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-d83e3ddb148bc0c81ff97bd31b82027d5b37efc110f5981103e7b9a2ae281c86.yml
3-
openapi_spec_hash: f607b0571c4ed82a93a3df7bc9e9351b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-9e397c65ffb81e2928b8ecf979769a79131ae6058b6fb373a5e930dc8a168732.yml
3+
openapi_spec_hash: 93aea3855d2d1c390107d223762aa818
44
config_hash: 5bb913c05ebeb301ec925b16e75bb251

src/lithic/resources/transaction_monitoring/cases/cases.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union, Optional
5+
from typing import Any, Dict, Union, Optional, cast
66
from datetime import datetime
77

88
import httpx
@@ -417,7 +417,7 @@ def list_transactions(
417417
case_list_transactions_params.CaseListTransactionsParams,
418418
),
419419
),
420-
model=CaseTransaction,
420+
model=cast(Any, CaseTransaction), # Union types cannot be passed in as arguments in the type system
421421
)
422422

423423
def retrieve_cards(
@@ -818,7 +818,7 @@ def list_transactions(
818818
case_list_transactions_params.CaseListTransactionsParams,
819819
),
820820
),
821-
model=CaseTransaction,
821+
model=cast(Any, CaseTransaction), # Union types cannot be passed in as arguments in the type system
822822
)
823823

824824
async def retrieve_cards(
Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from typing import Union, Optional
34
from datetime import datetime
5+
from typing_extensions import Literal, TypeAlias
46

57
from ..._models import BaseModel
68

7-
__all__ = ["CaseTransaction"]
9+
__all__ = ["CaseTransaction", "CardCaseTransaction", "PaymentCaseTransaction"]
810

911

10-
class CaseTransaction(BaseModel):
11-
"""A single transaction associated with a case"""
12+
class CardCaseTransaction(BaseModel):
13+
"""A card transaction associated with a case"""
1214

1315
token: str
14-
"""Globally unique identifier for the transaction"""
16+
"""Globally unique identifier for the card transaction"""
1517

1618
account_token: str
1719
"""Token of the account the transaction belongs to"""
@@ -22,5 +24,31 @@ class CaseTransaction(BaseModel):
2224
card_token: str
2325
"""Token of the card the transaction was made on"""
2426

27+
category: Literal["CARD"]
28+
29+
transaction_created_at: datetime
30+
"""Date and time at which the transaction was created"""
31+
32+
33+
class PaymentCaseTransaction(BaseModel):
34+
"""A payment (ACH) transaction associated with a case"""
35+
36+
token: str
37+
"""Globally unique identifier for the payment transaction"""
38+
39+
added_at: datetime
40+
"""Date and time at which the transaction was added to the case"""
41+
42+
category: Literal["PAYMENT"]
43+
44+
financial_account_token: str
45+
"""Token of the financial account the payment belongs to"""
46+
2547
transaction_created_at: datetime
2648
"""Date and time at which the transaction was created"""
49+
50+
account_token: Optional[str] = None
51+
"""Token of the account the payment belongs to, if applicable"""
52+
53+
54+
CaseTransaction: TypeAlias = Union[CardCaseTransaction, PaymentCaseTransaction]

0 commit comments

Comments
 (0)