Skip to content

Commit a476549

Browse files
feat(api): Add Hold API for financial account fund reservations
1 parent 4160169 commit a476549

4 files changed

Lines changed: 23 additions & 3 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: 184
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-df289940d26615072a7c5c9dd4d32b9bc7a86d977642b377c58abbe7a4cb93d0.yml
3-
openapi_spec_hash: 836bb078df7ac5f8d2dd5081c2e833be
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-45bd51c1d7885bde620179da56671e3378571e301528c60975604c4fbaa2c800.yml
3+
openapi_spec_hash: e1355583b829f269875b6f800078a9e0
44
config_hash: fb5070d41fcabdedbc084b83964b592a

src/lithic/resources/payments.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def create(
6666
method_attributes: payment_create_params.MethodAttributes,
6767
type: Literal["COLLECTION", "PAYMENT"],
6868
token: str | Omit = omit,
69+
hold: payment_create_params.Hold | Omit = omit,
6970
memo: str | Omit = omit,
7071
user_defined_id: str | Omit = omit,
7172
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -82,6 +83,8 @@ def create(
8283
token: Customer-provided token that will serve as an idempotency token. This token will
8384
become the transaction token.
8485
86+
hold: Optional hold to settle when this payment is initiated.
87+
8588
extra_headers: Send extra headers
8689
8790
extra_query: Add additional query parameters to the request
@@ -101,6 +104,7 @@ def create(
101104
"method_attributes": method_attributes,
102105
"type": type,
103106
"token": token,
107+
"hold": hold,
104108
"memo": memo,
105109
"user_defined_id": user_defined_id,
106110
},
@@ -566,6 +570,7 @@ async def create(
566570
method_attributes: payment_create_params.MethodAttributes,
567571
type: Literal["COLLECTION", "PAYMENT"],
568572
token: str | Omit = omit,
573+
hold: payment_create_params.Hold | Omit = omit,
569574
memo: str | Omit = omit,
570575
user_defined_id: str | Omit = omit,
571576
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -582,6 +587,8 @@ async def create(
582587
token: Customer-provided token that will serve as an idempotency token. This token will
583588
become the transaction token.
584589
590+
hold: Optional hold to settle when this payment is initiated.
591+
585592
extra_headers: Send extra headers
586593
587594
extra_query: Add additional query parameters to the request
@@ -601,6 +608,7 @@ async def create(
601608
"method_attributes": method_attributes,
602609
"type": type,
603610
"token": token,
611+
"hold": hold,
604612
"memo": memo,
605613
"user_defined_id": user_defined_id,
606614
},

src/lithic/types/payment_create_params.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Optional
66
from typing_extensions import Literal, Required, TypedDict
77

8-
__all__ = ["PaymentCreateParams", "MethodAttributes"]
8+
__all__ = ["PaymentCreateParams", "MethodAttributes", "Hold"]
99

1010

1111
class PaymentCreateParams(TypedDict, total=False):
@@ -27,6 +27,9 @@ class PaymentCreateParams(TypedDict, total=False):
2727
This token will become the transaction token.
2828
"""
2929

30+
hold: Hold
31+
"""Optional hold to settle when this payment is initiated."""
32+
3033
memo: str
3134

3235
user_defined_id: str
@@ -39,3 +42,10 @@ class MethodAttributes(TypedDict, total=False):
3942
"""Number of days to hold the ACH payment"""
4043

4144
addenda: Optional[str]
45+
46+
47+
class Hold(TypedDict, total=False):
48+
"""Optional hold to settle when this payment is initiated."""
49+
50+
token: Required[str]
51+
"""Token of the hold to settle when this payment is initiated."""

tests/api_resources/test_payments.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_method_create_with_all_params(self, client: Lithic) -> None:
5353
},
5454
type="COLLECTION",
5555
token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
56+
hold={"token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"},
5657
memo="memo",
5758
user_defined_id="user_defined_id",
5859
)
@@ -475,6 +476,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncLithic) ->
475476
},
476477
type="COLLECTION",
477478
token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
479+
hold={"token": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"},
478480
memo="memo",
479481
user_defined_id="user_defined_id",
480482
)

0 commit comments

Comments
 (0)