|
12 | 12 | from ... import _legacy_response |
13 | 13 | from ...types import ( |
14 | 14 | transaction_list_params, |
| 15 | + transaction_route_params, |
15 | 16 | transaction_simulate_void_params, |
16 | 17 | transaction_simulate_return_params, |
17 | 18 | transaction_simulate_clearing_params, |
@@ -239,6 +240,47 @@ def expire_authorization( |
239 | 240 | cast_to=NoneType, |
240 | 241 | ) |
241 | 242 |
|
| 243 | + def route( |
| 244 | + self, |
| 245 | + transaction_token: str, |
| 246 | + *, |
| 247 | + financial_account_token: str, |
| 248 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 249 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 250 | + extra_headers: Headers | None = None, |
| 251 | + extra_query: Query | None = None, |
| 252 | + extra_body: Body | None = None, |
| 253 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 254 | + ) -> None: |
| 255 | + """Route a card transaction to a financial account. |
| 256 | +
|
| 257 | + Only available for select use |
| 258 | + cases and programs. |
| 259 | +
|
| 260 | + Args: |
| 261 | + financial_account_token: The token of the financial account to route the transaction to. |
| 262 | +
|
| 263 | + extra_headers: Send extra headers |
| 264 | +
|
| 265 | + extra_query: Add additional query parameters to the request |
| 266 | +
|
| 267 | + extra_body: Add additional JSON properties to the request |
| 268 | +
|
| 269 | + timeout: Override the client-level default timeout for this request, in seconds |
| 270 | + """ |
| 271 | + if not transaction_token: |
| 272 | + raise ValueError(f"Expected a non-empty value for `transaction_token` but received {transaction_token!r}") |
| 273 | + return self._post( |
| 274 | + path_template("/v1/transactions/{transaction_token}/route", transaction_token=transaction_token), |
| 275 | + body=maybe_transform( |
| 276 | + {"financial_account_token": financial_account_token}, transaction_route_params.TransactionRouteParams |
| 277 | + ), |
| 278 | + options=make_request_options( |
| 279 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 280 | + ), |
| 281 | + cast_to=NoneType, |
| 282 | + ) |
| 283 | + |
242 | 284 | def simulate_authorization( |
243 | 285 | self, |
244 | 286 | *, |
@@ -942,6 +984,47 @@ async def expire_authorization( |
942 | 984 | cast_to=NoneType, |
943 | 985 | ) |
944 | 986 |
|
| 987 | + async def route( |
| 988 | + self, |
| 989 | + transaction_token: str, |
| 990 | + *, |
| 991 | + financial_account_token: str, |
| 992 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 993 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 994 | + extra_headers: Headers | None = None, |
| 995 | + extra_query: Query | None = None, |
| 996 | + extra_body: Body | None = None, |
| 997 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 998 | + ) -> None: |
| 999 | + """Route a card transaction to a financial account. |
| 1000 | +
|
| 1001 | + Only available for select use |
| 1002 | + cases and programs. |
| 1003 | +
|
| 1004 | + Args: |
| 1005 | + financial_account_token: The token of the financial account to route the transaction to. |
| 1006 | +
|
| 1007 | + extra_headers: Send extra headers |
| 1008 | +
|
| 1009 | + extra_query: Add additional query parameters to the request |
| 1010 | +
|
| 1011 | + extra_body: Add additional JSON properties to the request |
| 1012 | +
|
| 1013 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1014 | + """ |
| 1015 | + if not transaction_token: |
| 1016 | + raise ValueError(f"Expected a non-empty value for `transaction_token` but received {transaction_token!r}") |
| 1017 | + return await self._post( |
| 1018 | + path_template("/v1/transactions/{transaction_token}/route", transaction_token=transaction_token), |
| 1019 | + body=await async_maybe_transform( |
| 1020 | + {"financial_account_token": financial_account_token}, transaction_route_params.TransactionRouteParams |
| 1021 | + ), |
| 1022 | + options=make_request_options( |
| 1023 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 1024 | + ), |
| 1025 | + cast_to=NoneType, |
| 1026 | + ) |
| 1027 | + |
945 | 1028 | async def simulate_authorization( |
946 | 1029 | self, |
947 | 1030 | *, |
@@ -1478,6 +1561,9 @@ def __init__(self, transactions: Transactions) -> None: |
1478 | 1561 | self.expire_authorization = _legacy_response.to_raw_response_wrapper( |
1479 | 1562 | transactions.expire_authorization, |
1480 | 1563 | ) |
| 1564 | + self.route = _legacy_response.to_raw_response_wrapper( |
| 1565 | + transactions.route, |
| 1566 | + ) |
1481 | 1567 | self.simulate_authorization = _legacy_response.to_raw_response_wrapper( |
1482 | 1568 | transactions.simulate_authorization, |
1483 | 1569 | ) |
@@ -1527,6 +1613,9 @@ def __init__(self, transactions: AsyncTransactions) -> None: |
1527 | 1613 | self.expire_authorization = _legacy_response.async_to_raw_response_wrapper( |
1528 | 1614 | transactions.expire_authorization, |
1529 | 1615 | ) |
| 1616 | + self.route = _legacy_response.async_to_raw_response_wrapper( |
| 1617 | + transactions.route, |
| 1618 | + ) |
1530 | 1619 | self.simulate_authorization = _legacy_response.async_to_raw_response_wrapper( |
1531 | 1620 | transactions.simulate_authorization, |
1532 | 1621 | ) |
@@ -1576,6 +1665,9 @@ def __init__(self, transactions: Transactions) -> None: |
1576 | 1665 | self.expire_authorization = to_streamed_response_wrapper( |
1577 | 1666 | transactions.expire_authorization, |
1578 | 1667 | ) |
| 1668 | + self.route = to_streamed_response_wrapper( |
| 1669 | + transactions.route, |
| 1670 | + ) |
1579 | 1671 | self.simulate_authorization = to_streamed_response_wrapper( |
1580 | 1672 | transactions.simulate_authorization, |
1581 | 1673 | ) |
@@ -1625,6 +1717,9 @@ def __init__(self, transactions: AsyncTransactions) -> None: |
1625 | 1717 | self.expire_authorization = async_to_streamed_response_wrapper( |
1626 | 1718 | transactions.expire_authorization, |
1627 | 1719 | ) |
| 1720 | + self.route = async_to_streamed_response_wrapper( |
| 1721 | + transactions.route, |
| 1722 | + ) |
1628 | 1723 | self.simulate_authorization = async_to_streamed_response_wrapper( |
1629 | 1724 | transactions.simulate_authorization, |
1630 | 1725 | ) |
|
0 commit comments