|
25 | 25 | card_provision_params, |
26 | 26 | card_get_embed_url_params, |
27 | 27 | card_search_by_pan_params, |
| 28 | + card_web_provision_params, |
28 | 29 | card_convert_physical_params, |
29 | 30 | ) |
30 | 31 | from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, Base64FileInput |
|
64 | 65 | from ...types.spend_limit_duration import SpendLimitDuration |
65 | 66 | from ...types.shared_params.carrier import Carrier |
66 | 67 | from ...types.card_provision_response import CardProvisionResponse |
| 68 | +from ...types.card_web_provision_response import CardWebProvisionResponse |
67 | 69 | from ...types.shared_params.shipping_address import ShippingAddress |
68 | 70 |
|
69 | 71 | __all__ = ["Cards", "AsyncCards"] |
@@ -1059,6 +1061,48 @@ def search_by_pan( |
1059 | 1061 | cast_to=Card, |
1060 | 1062 | ) |
1061 | 1063 |
|
| 1064 | + def web_provision( |
| 1065 | + self, |
| 1066 | + card_token: str, |
| 1067 | + *, |
| 1068 | + digital_wallet: Literal["APPLE_PAY"] | NotGiven = NOT_GIVEN, |
| 1069 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1070 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1071 | + extra_headers: Headers | None = None, |
| 1072 | + extra_query: Query | None = None, |
| 1073 | + extra_body: Body | None = None, |
| 1074 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 1075 | + ) -> CardWebProvisionResponse: |
| 1076 | + """ |
| 1077 | + Allow your cardholders to directly add payment cards to the device's digital |
| 1078 | + wallet from a browser on the web. Currently only suported for Apple Pay. |
| 1079 | +
|
| 1080 | + This requires some additional setup and configuration. Please |
| 1081 | + [Contact Us](https://lithic.com/contact) or your Customer Success representative |
| 1082 | + for more information. |
| 1083 | +
|
| 1084 | + Args: |
| 1085 | + digital_wallet: Name of digital wallet provider. |
| 1086 | +
|
| 1087 | + extra_headers: Send extra headers |
| 1088 | +
|
| 1089 | + extra_query: Add additional query parameters to the request |
| 1090 | +
|
| 1091 | + extra_body: Add additional JSON properties to the request |
| 1092 | +
|
| 1093 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1094 | + """ |
| 1095 | + if not card_token: |
| 1096 | + raise ValueError(f"Expected a non-empty value for `card_token` but received {card_token!r}") |
| 1097 | + return self._post( |
| 1098 | + f"/v1/cards/{card_token}/web_provision", |
| 1099 | + body=maybe_transform({"digital_wallet": digital_wallet}, card_web_provision_params.CardWebProvisionParams), |
| 1100 | + options=make_request_options( |
| 1101 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 1102 | + ), |
| 1103 | + cast_to=CardWebProvisionResponse, |
| 1104 | + ) |
| 1105 | + |
1062 | 1106 |
|
1063 | 1107 | class AsyncCards(AsyncAPIResource): |
1064 | 1108 | @cached_property |
@@ -2050,6 +2094,50 @@ async def search_by_pan( |
2050 | 2094 | cast_to=Card, |
2051 | 2095 | ) |
2052 | 2096 |
|
| 2097 | + async def web_provision( |
| 2098 | + self, |
| 2099 | + card_token: str, |
| 2100 | + *, |
| 2101 | + digital_wallet: Literal["APPLE_PAY"] | NotGiven = NOT_GIVEN, |
| 2102 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 2103 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 2104 | + extra_headers: Headers | None = None, |
| 2105 | + extra_query: Query | None = None, |
| 2106 | + extra_body: Body | None = None, |
| 2107 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 2108 | + ) -> CardWebProvisionResponse: |
| 2109 | + """ |
| 2110 | + Allow your cardholders to directly add payment cards to the device's digital |
| 2111 | + wallet from a browser on the web. Currently only suported for Apple Pay. |
| 2112 | +
|
| 2113 | + This requires some additional setup and configuration. Please |
| 2114 | + [Contact Us](https://lithic.com/contact) or your Customer Success representative |
| 2115 | + for more information. |
| 2116 | +
|
| 2117 | + Args: |
| 2118 | + digital_wallet: Name of digital wallet provider. |
| 2119 | +
|
| 2120 | + extra_headers: Send extra headers |
| 2121 | +
|
| 2122 | + extra_query: Add additional query parameters to the request |
| 2123 | +
|
| 2124 | + extra_body: Add additional JSON properties to the request |
| 2125 | +
|
| 2126 | + timeout: Override the client-level default timeout for this request, in seconds |
| 2127 | + """ |
| 2128 | + if not card_token: |
| 2129 | + raise ValueError(f"Expected a non-empty value for `card_token` but received {card_token!r}") |
| 2130 | + return await self._post( |
| 2131 | + f"/v1/cards/{card_token}/web_provision", |
| 2132 | + body=await async_maybe_transform( |
| 2133 | + {"digital_wallet": digital_wallet}, card_web_provision_params.CardWebProvisionParams |
| 2134 | + ), |
| 2135 | + options=make_request_options( |
| 2136 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 2137 | + ), |
| 2138 | + cast_to=CardWebProvisionResponse, |
| 2139 | + ) |
| 2140 | + |
2053 | 2141 |
|
2054 | 2142 | class CardsWithRawResponse: |
2055 | 2143 | def __init__(self, cards: Cards) -> None: |
@@ -2088,6 +2176,9 @@ def __init__(self, cards: Cards) -> None: |
2088 | 2176 | self.search_by_pan = _legacy_response.to_raw_response_wrapper( |
2089 | 2177 | cards.search_by_pan, |
2090 | 2178 | ) |
| 2179 | + self.web_provision = _legacy_response.to_raw_response_wrapper( |
| 2180 | + cards.web_provision, |
| 2181 | + ) |
2091 | 2182 |
|
2092 | 2183 | @cached_property |
2093 | 2184 | def aggregate_balances(self) -> AggregateBalancesWithRawResponse: |
@@ -2139,6 +2230,9 @@ def __init__(self, cards: AsyncCards) -> None: |
2139 | 2230 | self.search_by_pan = _legacy_response.async_to_raw_response_wrapper( |
2140 | 2231 | cards.search_by_pan, |
2141 | 2232 | ) |
| 2233 | + self.web_provision = _legacy_response.async_to_raw_response_wrapper( |
| 2234 | + cards.web_provision, |
| 2235 | + ) |
2142 | 2236 |
|
2143 | 2237 | @cached_property |
2144 | 2238 | def aggregate_balances(self) -> AsyncAggregateBalancesWithRawResponse: |
@@ -2190,6 +2284,9 @@ def __init__(self, cards: Cards) -> None: |
2190 | 2284 | self.search_by_pan = to_streamed_response_wrapper( |
2191 | 2285 | cards.search_by_pan, |
2192 | 2286 | ) |
| 2287 | + self.web_provision = to_streamed_response_wrapper( |
| 2288 | + cards.web_provision, |
| 2289 | + ) |
2193 | 2290 |
|
2194 | 2291 | @cached_property |
2195 | 2292 | def aggregate_balances(self) -> AggregateBalancesWithStreamingResponse: |
@@ -2241,6 +2338,9 @@ def __init__(self, cards: AsyncCards) -> None: |
2241 | 2338 | self.search_by_pan = async_to_streamed_response_wrapper( |
2242 | 2339 | cards.search_by_pan, |
2243 | 2340 | ) |
| 2341 | + self.web_provision = async_to_streamed_response_wrapper( |
| 2342 | + cards.web_provision, |
| 2343 | + ) |
2244 | 2344 |
|
2245 | 2345 | @cached_property |
2246 | 2346 | def aggregate_balances(self) -> AsyncAggregateBalancesWithStreamingResponse: |
|
0 commit comments