checkout-intents 0.5.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checkout_intents-0.7.0/.release-please-manifest.json +3 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/CHANGELOG.md +21 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/PKG-INFO +1 -1
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/api.md +1 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/pyproject.toml +1 -1
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_version.py +1 -1
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/resources/checkout_intents.py +125 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/__init__.py +1 -0
- checkout_intents-0.7.0/src/checkout_intents/types/checkout_intent_purchase_params.py +28 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/api_resources/test_checkout_intents.py +228 -0
- checkout_intents-0.5.0/.release-please-manifest.json +0 -3
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/.gitignore +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/CONTRIBUTING.md +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/LICENSE +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/README.md +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/SECURITY.md +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/bin/check-release-environment +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/bin/publish-pypi +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/examples/.keep +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/examples/complete-checkout-intent.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/examples/error-handling.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/noxfile.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/release-please-config.json +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/requirements-dev.lock +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/requirements.lock +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/__init__.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_base_client.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_client.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_compat.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_constants.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_exceptions.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_files.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_models.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_qs.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_resource.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_response.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_streaming.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_types.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/__init__.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_compat.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_datetime_parse.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_logs.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_proxy.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_reflection.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_resources_proxy.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_streams.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_sync.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_transform.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_typing.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_utils.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/lib/.keep +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/pagination.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/py.typed +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/resources/__init__.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/resources/brands.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/base_checkout_intent.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/brand_retrieve_response.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/buyer.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/buyer_param.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/checkout_intent.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/checkout_intent_add_payment_params.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/checkout_intent_confirm_params.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/checkout_intent_create_params.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/checkout_intent_list_params.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/money.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/offer.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/payment_method.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/payment_method_param.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/variant_selection.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/variant_selection_param.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/__init__.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/api_resources/__init__.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/api_resources/test_brands.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/conftest.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/sample_file.txt +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_client.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_deepcopy.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_environment_inference.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_extract_files.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_files.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_models.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_polling.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_qs.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_required_args.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_response.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_streaming.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_transform.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_utils/test_proxy.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/test_utils/test_typing.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/utils.py +0 -0
- {checkout_intents-0.5.0 → checkout_intents-0.7.0}/uv.lock +0 -0
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.0 (2025-12-22)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.6.0...v0.7.0](https://github.com/rye-com/checkout-intents-python/compare/v0.6.0...v0.7.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** support promo codes in purchase endpoint ([db9b7ca](https://github.com/rye-com/checkout-intents-python/commit/db9b7caa613c20a0d516930551f89932be8f14d9))
|
|
10
|
+
|
|
11
|
+
## 0.6.0 (2025-12-22)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.5.0...v0.6.0](https://github.com/rye-com/checkout-intents-python/compare/v0.5.0...v0.6.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* Include `/purchase` endpoint in our SDKs + docs ([7744f80](https://github.com/rye-com/checkout-intents-python/commit/7744f80e20bc5399d9b29e0bfb11d6b8f9997e38))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
|
|
22
|
+
* include polling helpers in raw resp classes ([67b0e3c](https://github.com/rye-com/checkout-intents-python/commit/67b0e3c1899a3d5415b126466fd5f525f61f2529))
|
|
23
|
+
|
|
3
24
|
## 0.5.0 (2025-12-19)
|
|
4
25
|
|
|
5
26
|
Full Changelog: [v0.4.0...v0.5.0](https://github.com/rye-com/checkout-intents-python/compare/v0.4.0...v0.5.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: checkout-intents
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: The official Python library for the Checkout Intents API
|
|
5
5
|
Project-URL: Homepage, https://github.com/rye-com/checkout-intents-python
|
|
6
6
|
Project-URL: Repository, https://github.com/rye-com/checkout-intents-python
|
|
@@ -21,6 +21,7 @@ Methods:
|
|
|
21
21
|
- <code title="get /api/v1/checkout-intents">client.checkout_intents.<a href="./src/checkout_intents/resources/checkout_intents.py">list</a>(\*\*<a href="src/checkout_intents/types/checkout_intent_list_params.py">params</a>) -> <a href="./src/checkout_intents/types/checkout_intent.py">SyncCursorPagination[CheckoutIntent]</a></code>
|
|
22
22
|
- <code title="post /api/v1/checkout-intents/{id}/payment">client.checkout_intents.<a href="./src/checkout_intents/resources/checkout_intents.py">add_payment</a>(id, \*\*<a href="src/checkout_intents/types/checkout_intent_add_payment_params.py">params</a>) -> <a href="./src/checkout_intents/types/checkout_intent.py">CheckoutIntent</a></code>
|
|
23
23
|
- <code title="post /api/v1/checkout-intents/{id}/confirm">client.checkout_intents.<a href="./src/checkout_intents/resources/checkout_intents.py">confirm</a>(id, \*\*<a href="src/checkout_intents/types/checkout_intent_confirm_params.py">params</a>) -> <a href="./src/checkout_intents/types/checkout_intent.py">CheckoutIntent</a></code>
|
|
24
|
+
- <code title="post /api/v1/checkout-intents/purchase">client.checkout_intents.<a href="./src/checkout_intents/resources/checkout_intents.py">purchase</a>(\*\*<a href="src/checkout_intents/types/checkout_intent_purchase_params.py">params</a>) -> <a href="./src/checkout_intents/types/checkout_intent.py">CheckoutIntent</a></code>
|
|
24
25
|
|
|
25
26
|
# Brands
|
|
26
27
|
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/resources/checkout_intents.py
RENAMED
|
@@ -12,6 +12,7 @@ from ..types import (
|
|
|
12
12
|
checkout_intent_list_params,
|
|
13
13
|
checkout_intent_create_params,
|
|
14
14
|
checkout_intent_confirm_params,
|
|
15
|
+
checkout_intent_purchase_params,
|
|
15
16
|
checkout_intent_add_payment_params,
|
|
16
17
|
)
|
|
17
18
|
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
@@ -287,6 +288,60 @@ class CheckoutIntentsResource(SyncAPIResource):
|
|
|
287
288
|
),
|
|
288
289
|
)
|
|
289
290
|
|
|
291
|
+
def purchase(
|
|
292
|
+
self,
|
|
293
|
+
*,
|
|
294
|
+
buyer: BuyerParam,
|
|
295
|
+
product_url: str,
|
|
296
|
+
quantity: float,
|
|
297
|
+
promo_codes: SequenceNotStr[str] | Omit = omit,
|
|
298
|
+
variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
|
|
299
|
+
payment_method: PaymentMethodParam,
|
|
300
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
301
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
302
|
+
extra_headers: Headers | None = None,
|
|
303
|
+
extra_query: Query | None = None,
|
|
304
|
+
extra_body: Body | None = None,
|
|
305
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
306
|
+
) -> CheckoutIntent:
|
|
307
|
+
"""
|
|
308
|
+
Create a checkout intent and immediately trigger the purchase workflow.
|
|
309
|
+
|
|
310
|
+
This is a "fire-and-forget" endpoint that combines create + confirm in one step.
|
|
311
|
+
The workflow handles offer retrieval, payment authorization, and order placement
|
|
312
|
+
asynchronously. Poll the GET endpoint to check status.
|
|
313
|
+
|
|
314
|
+
Args:
|
|
315
|
+
extra_headers: Send extra headers
|
|
316
|
+
|
|
317
|
+
extra_query: Add additional query parameters to the request
|
|
318
|
+
|
|
319
|
+
extra_body: Add additional JSON properties to the request
|
|
320
|
+
|
|
321
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
322
|
+
"""
|
|
323
|
+
return cast(
|
|
324
|
+
CheckoutIntent,
|
|
325
|
+
self._post(
|
|
326
|
+
f"/api/v1/checkout-intents/purchase",
|
|
327
|
+
body=maybe_transform(
|
|
328
|
+
{
|
|
329
|
+
"buyer": buyer,
|
|
330
|
+
"payment_method": payment_method,
|
|
331
|
+
"product_url": product_url,
|
|
332
|
+
"quantity": quantity,
|
|
333
|
+
"promo_codes": promo_codes,
|
|
334
|
+
"variant_selections": variant_selections,
|
|
335
|
+
},
|
|
336
|
+
checkout_intent_purchase_params.CheckoutIntentPurchaseParams
|
|
337
|
+
),
|
|
338
|
+
options=make_request_options(
|
|
339
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
340
|
+
),
|
|
341
|
+
cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
|
|
342
|
+
),
|
|
343
|
+
)
|
|
344
|
+
|
|
290
345
|
def _poll_until(
|
|
291
346
|
self,
|
|
292
347
|
id: str,
|
|
@@ -890,6 +945,60 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
|
|
|
890
945
|
),
|
|
891
946
|
)
|
|
892
947
|
|
|
948
|
+
async def purchase(
|
|
949
|
+
self,
|
|
950
|
+
*,
|
|
951
|
+
buyer: BuyerParam,
|
|
952
|
+
product_url: str,
|
|
953
|
+
quantity: float,
|
|
954
|
+
promo_codes: SequenceNotStr[str] | Omit = omit,
|
|
955
|
+
variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
|
|
956
|
+
payment_method: PaymentMethodParam,
|
|
957
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
958
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
959
|
+
extra_headers: Headers | None = None,
|
|
960
|
+
extra_query: Query | None = None,
|
|
961
|
+
extra_body: Body | None = None,
|
|
962
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
963
|
+
) -> CheckoutIntent:
|
|
964
|
+
"""
|
|
965
|
+
Create a checkout intent and immediately trigger the purchase workflow.
|
|
966
|
+
|
|
967
|
+
This is a "fire-and-forget" endpoint that combines create + confirm in one step.
|
|
968
|
+
The workflow handles offer retrieval, payment authorization, and order placement
|
|
969
|
+
asynchronously. Poll the GET endpoint to check status.
|
|
970
|
+
|
|
971
|
+
Args:
|
|
972
|
+
extra_headers: Send extra headers
|
|
973
|
+
|
|
974
|
+
extra_query: Add additional query parameters to the request
|
|
975
|
+
|
|
976
|
+
extra_body: Add additional JSON properties to the request
|
|
977
|
+
|
|
978
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
979
|
+
"""
|
|
980
|
+
return cast(
|
|
981
|
+
CheckoutIntent,
|
|
982
|
+
await self._post(
|
|
983
|
+
f"/api/v1/checkout-intents/purchase",
|
|
984
|
+
body=await async_maybe_transform(
|
|
985
|
+
{
|
|
986
|
+
"buyer": buyer,
|
|
987
|
+
"payment_method": payment_method,
|
|
988
|
+
"product_url": product_url,
|
|
989
|
+
"quantity": quantity,
|
|
990
|
+
"promo_codes": promo_codes,
|
|
991
|
+
"variant_selections": variant_selections,
|
|
992
|
+
},
|
|
993
|
+
checkout_intent_purchase_params.CheckoutIntentPurchaseParams
|
|
994
|
+
),
|
|
995
|
+
options=make_request_options(
|
|
996
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
997
|
+
),
|
|
998
|
+
cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
|
|
999
|
+
),
|
|
1000
|
+
)
|
|
1001
|
+
|
|
893
1002
|
async def _poll_until(
|
|
894
1003
|
self,
|
|
895
1004
|
id: str,
|
|
@@ -1250,6 +1359,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
|
|
|
1250
1359
|
)
|
|
1251
1360
|
|
|
1252
1361
|
|
|
1362
|
+
|
|
1253
1363
|
class CheckoutIntentsResourceWithRawResponse:
|
|
1254
1364
|
def __init__(self, checkout_intents: CheckoutIntentsResource) -> None:
|
|
1255
1365
|
self._checkout_intents = checkout_intents
|
|
@@ -1269,6 +1379,9 @@ class CheckoutIntentsResourceWithRawResponse:
|
|
|
1269
1379
|
self.confirm = to_raw_response_wrapper(
|
|
1270
1380
|
checkout_intents.confirm,
|
|
1271
1381
|
)
|
|
1382
|
+
self.purchase = to_raw_response_wrapper(
|
|
1383
|
+
checkout_intents.purchase,
|
|
1384
|
+
)
|
|
1272
1385
|
self.poll_until_completed = to_raw_response_wrapper(
|
|
1273
1386
|
checkout_intents.poll_until_completed,
|
|
1274
1387
|
)
|
|
@@ -1283,6 +1396,7 @@ class CheckoutIntentsResourceWithRawResponse:
|
|
|
1283
1396
|
)
|
|
1284
1397
|
|
|
1285
1398
|
|
|
1399
|
+
|
|
1286
1400
|
class AsyncCheckoutIntentsResourceWithRawResponse:
|
|
1287
1401
|
def __init__(self, checkout_intents: AsyncCheckoutIntentsResource) -> None:
|
|
1288
1402
|
self._checkout_intents = checkout_intents
|
|
@@ -1302,6 +1416,9 @@ class AsyncCheckoutIntentsResourceWithRawResponse:
|
|
|
1302
1416
|
self.confirm = async_to_raw_response_wrapper(
|
|
1303
1417
|
checkout_intents.confirm,
|
|
1304
1418
|
)
|
|
1419
|
+
self.purchase = async_to_raw_response_wrapper(
|
|
1420
|
+
checkout_intents.purchase,
|
|
1421
|
+
)
|
|
1305
1422
|
self.poll_until_completed = async_to_raw_response_wrapper(
|
|
1306
1423
|
checkout_intents.poll_until_completed,
|
|
1307
1424
|
)
|
|
@@ -1316,6 +1433,7 @@ class AsyncCheckoutIntentsResourceWithRawResponse:
|
|
|
1316
1433
|
)
|
|
1317
1434
|
|
|
1318
1435
|
|
|
1436
|
+
|
|
1319
1437
|
class CheckoutIntentsResourceWithStreamingResponse:
|
|
1320
1438
|
def __init__(self, checkout_intents: CheckoutIntentsResource) -> None:
|
|
1321
1439
|
self._checkout_intents = checkout_intents
|
|
@@ -1335,6 +1453,9 @@ class CheckoutIntentsResourceWithStreamingResponse:
|
|
|
1335
1453
|
self.confirm = to_streamed_response_wrapper(
|
|
1336
1454
|
checkout_intents.confirm,
|
|
1337
1455
|
)
|
|
1456
|
+
self.purchase = to_streamed_response_wrapper(
|
|
1457
|
+
checkout_intents.purchase,
|
|
1458
|
+
)
|
|
1338
1459
|
self.poll_until_completed = to_streamed_response_wrapper(
|
|
1339
1460
|
checkout_intents.poll_until_completed,
|
|
1340
1461
|
)
|
|
@@ -1349,6 +1470,7 @@ class CheckoutIntentsResourceWithStreamingResponse:
|
|
|
1349
1470
|
)
|
|
1350
1471
|
|
|
1351
1472
|
|
|
1473
|
+
|
|
1352
1474
|
class AsyncCheckoutIntentsResourceWithStreamingResponse:
|
|
1353
1475
|
def __init__(self, checkout_intents: AsyncCheckoutIntentsResource) -> None:
|
|
1354
1476
|
self._checkout_intents = checkout_intents
|
|
@@ -1368,6 +1490,9 @@ class AsyncCheckoutIntentsResourceWithStreamingResponse:
|
|
|
1368
1490
|
self.confirm = async_to_streamed_response_wrapper(
|
|
1369
1491
|
checkout_intents.confirm,
|
|
1370
1492
|
)
|
|
1493
|
+
self.purchase = async_to_streamed_response_wrapper(
|
|
1494
|
+
checkout_intents.purchase,
|
|
1495
|
+
)
|
|
1371
1496
|
self.poll_until_completed = async_to_streamed_response_wrapper(
|
|
1372
1497
|
checkout_intents.poll_until_completed,
|
|
1373
1498
|
)
|
|
@@ -16,4 +16,5 @@ from .variant_selection_param import VariantSelectionParam as VariantSelectionPa
|
|
|
16
16
|
from .checkout_intent_list_params import CheckoutIntentListParams as CheckoutIntentListParams
|
|
17
17
|
from .checkout_intent_create_params import CheckoutIntentCreateParams as CheckoutIntentCreateParams
|
|
18
18
|
from .checkout_intent_confirm_params import CheckoutIntentConfirmParams as CheckoutIntentConfirmParams
|
|
19
|
+
from .checkout_intent_purchase_params import CheckoutIntentPurchaseParams as CheckoutIntentPurchaseParams
|
|
19
20
|
from .checkout_intent_add_payment_params import CheckoutIntentAddPaymentParams as CheckoutIntentAddPaymentParams
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Iterable
|
|
6
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .._utils import PropertyInfo
|
|
10
|
+
from .buyer_param import BuyerParam
|
|
11
|
+
from .payment_method_param import PaymentMethodParam
|
|
12
|
+
from .variant_selection_param import VariantSelectionParam
|
|
13
|
+
|
|
14
|
+
__all__ = ["CheckoutIntentPurchaseParams"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class CheckoutIntentPurchaseParams(TypedDict, total=False):
|
|
18
|
+
buyer: Required[BuyerParam]
|
|
19
|
+
|
|
20
|
+
payment_method: Required[Annotated[PaymentMethodParam, PropertyInfo(alias="paymentMethod")]]
|
|
21
|
+
|
|
22
|
+
product_url: Required[Annotated[str, PropertyInfo(alias="productUrl")]]
|
|
23
|
+
|
|
24
|
+
quantity: Required[float]
|
|
25
|
+
|
|
26
|
+
promo_codes: Annotated[SequenceNotStr[str], PropertyInfo(alias="promoCodes")]
|
|
27
|
+
|
|
28
|
+
variant_selections: Annotated[Iterable[VariantSelectionParam], PropertyInfo(alias="variantSelections")]
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/tests/api_resources/test_checkout_intents.py
RENAMED
|
@@ -340,6 +340,120 @@ class TestCheckoutIntents:
|
|
|
340
340
|
},
|
|
341
341
|
)
|
|
342
342
|
|
|
343
|
+
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
344
|
+
@parametrize
|
|
345
|
+
def test_method_purchase(self, client: CheckoutIntents) -> None:
|
|
346
|
+
checkout_intent = client.checkout_intents.purchase(
|
|
347
|
+
buyer={
|
|
348
|
+
"address1": "123 Main St",
|
|
349
|
+
"city": "New York",
|
|
350
|
+
"country": "US",
|
|
351
|
+
"email": "john.doe@example.com",
|
|
352
|
+
"first_name": "John",
|
|
353
|
+
"last_name": "Doe",
|
|
354
|
+
"phone": "1234567890",
|
|
355
|
+
"postal_code": "10001",
|
|
356
|
+
"province": "NY",
|
|
357
|
+
},
|
|
358
|
+
payment_method={
|
|
359
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
360
|
+
"type": "stripe_token",
|
|
361
|
+
},
|
|
362
|
+
product_url="productUrl",
|
|
363
|
+
quantity=1,
|
|
364
|
+
)
|
|
365
|
+
assert_matches_type(CheckoutIntent, checkout_intent, path=["response"])
|
|
366
|
+
|
|
367
|
+
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
368
|
+
@parametrize
|
|
369
|
+
def test_method_purchase_with_all_params(self, client: CheckoutIntents) -> None:
|
|
370
|
+
checkout_intent = client.checkout_intents.purchase(
|
|
371
|
+
buyer={
|
|
372
|
+
"address1": "123 Main St",
|
|
373
|
+
"city": "New York",
|
|
374
|
+
"country": "US",
|
|
375
|
+
"email": "john.doe@example.com",
|
|
376
|
+
"first_name": "John",
|
|
377
|
+
"last_name": "Doe",
|
|
378
|
+
"phone": "1234567890",
|
|
379
|
+
"postal_code": "10001",
|
|
380
|
+
"province": "NY",
|
|
381
|
+
"address2": "Apt 1",
|
|
382
|
+
},
|
|
383
|
+
payment_method={
|
|
384
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
385
|
+
"type": "stripe_token",
|
|
386
|
+
},
|
|
387
|
+
product_url="productUrl",
|
|
388
|
+
quantity=1,
|
|
389
|
+
promo_codes=["string"],
|
|
390
|
+
variant_selections=[
|
|
391
|
+
{
|
|
392
|
+
"label": "Size, Color, etc.",
|
|
393
|
+
"value": "Small, Red, XS, L, etc.",
|
|
394
|
+
}
|
|
395
|
+
],
|
|
396
|
+
)
|
|
397
|
+
assert_matches_type(CheckoutIntent, checkout_intent, path=["response"])
|
|
398
|
+
|
|
399
|
+
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
400
|
+
@parametrize
|
|
401
|
+
def test_raw_response_purchase(self, client: CheckoutIntents) -> None:
|
|
402
|
+
response = client.checkout_intents.with_raw_response.purchase(
|
|
403
|
+
buyer={
|
|
404
|
+
"address1": "123 Main St",
|
|
405
|
+
"city": "New York",
|
|
406
|
+
"country": "US",
|
|
407
|
+
"email": "john.doe@example.com",
|
|
408
|
+
"first_name": "John",
|
|
409
|
+
"last_name": "Doe",
|
|
410
|
+
"phone": "1234567890",
|
|
411
|
+
"postal_code": "10001",
|
|
412
|
+
"province": "NY",
|
|
413
|
+
},
|
|
414
|
+
payment_method={
|
|
415
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
416
|
+
"type": "stripe_token",
|
|
417
|
+
},
|
|
418
|
+
product_url="productUrl",
|
|
419
|
+
quantity=1,
|
|
420
|
+
)
|
|
421
|
+
|
|
422
|
+
assert response.is_closed is True
|
|
423
|
+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
424
|
+
checkout_intent = response.parse()
|
|
425
|
+
assert_matches_type(CheckoutIntent, checkout_intent, path=["response"])
|
|
426
|
+
|
|
427
|
+
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
428
|
+
@parametrize
|
|
429
|
+
def test_streaming_response_purchase(self, client: CheckoutIntents) -> None:
|
|
430
|
+
with client.checkout_intents.with_streaming_response.purchase(
|
|
431
|
+
buyer={
|
|
432
|
+
"address1": "123 Main St",
|
|
433
|
+
"city": "New York",
|
|
434
|
+
"country": "US",
|
|
435
|
+
"email": "john.doe@example.com",
|
|
436
|
+
"first_name": "John",
|
|
437
|
+
"last_name": "Doe",
|
|
438
|
+
"phone": "1234567890",
|
|
439
|
+
"postal_code": "10001",
|
|
440
|
+
"province": "NY",
|
|
441
|
+
},
|
|
442
|
+
payment_method={
|
|
443
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
444
|
+
"type": "stripe_token",
|
|
445
|
+
},
|
|
446
|
+
product_url="productUrl",
|
|
447
|
+
quantity=1,
|
|
448
|
+
) as response:
|
|
449
|
+
assert not response.is_closed
|
|
450
|
+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
451
|
+
|
|
452
|
+
checkout_intent = response.parse()
|
|
453
|
+
assert_matches_type(CheckoutIntent, checkout_intent, path=["response"])
|
|
454
|
+
|
|
455
|
+
assert cast(Any, response.is_closed) is True
|
|
456
|
+
|
|
343
457
|
|
|
344
458
|
class TestAsyncCheckoutIntents:
|
|
345
459
|
parametrize = pytest.mark.parametrize(
|
|
@@ -665,3 +779,117 @@ class TestAsyncCheckoutIntents:
|
|
|
665
779
|
"type": "stripe_token",
|
|
666
780
|
},
|
|
667
781
|
)
|
|
782
|
+
|
|
783
|
+
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
784
|
+
@parametrize
|
|
785
|
+
async def test_method_purchase(self, async_client: AsyncCheckoutIntents) -> None:
|
|
786
|
+
checkout_intent = await async_client.checkout_intents.purchase(
|
|
787
|
+
buyer={
|
|
788
|
+
"address1": "123 Main St",
|
|
789
|
+
"city": "New York",
|
|
790
|
+
"country": "US",
|
|
791
|
+
"email": "john.doe@example.com",
|
|
792
|
+
"first_name": "John",
|
|
793
|
+
"last_name": "Doe",
|
|
794
|
+
"phone": "1234567890",
|
|
795
|
+
"postal_code": "10001",
|
|
796
|
+
"province": "NY",
|
|
797
|
+
},
|
|
798
|
+
payment_method={
|
|
799
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
800
|
+
"type": "stripe_token",
|
|
801
|
+
},
|
|
802
|
+
product_url="productUrl",
|
|
803
|
+
quantity=1,
|
|
804
|
+
)
|
|
805
|
+
assert_matches_type(CheckoutIntent, checkout_intent, path=["response"])
|
|
806
|
+
|
|
807
|
+
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
808
|
+
@parametrize
|
|
809
|
+
async def test_method_purchase_with_all_params(self, async_client: AsyncCheckoutIntents) -> None:
|
|
810
|
+
checkout_intent = await async_client.checkout_intents.purchase(
|
|
811
|
+
buyer={
|
|
812
|
+
"address1": "123 Main St",
|
|
813
|
+
"city": "New York",
|
|
814
|
+
"country": "US",
|
|
815
|
+
"email": "john.doe@example.com",
|
|
816
|
+
"first_name": "John",
|
|
817
|
+
"last_name": "Doe",
|
|
818
|
+
"phone": "1234567890",
|
|
819
|
+
"postal_code": "10001",
|
|
820
|
+
"province": "NY",
|
|
821
|
+
"address2": "Apt 1",
|
|
822
|
+
},
|
|
823
|
+
payment_method={
|
|
824
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
825
|
+
"type": "stripe_token",
|
|
826
|
+
},
|
|
827
|
+
product_url="productUrl",
|
|
828
|
+
quantity=1,
|
|
829
|
+
promo_codes=["string"],
|
|
830
|
+
variant_selections=[
|
|
831
|
+
{
|
|
832
|
+
"label": "Size, Color, etc.",
|
|
833
|
+
"value": "Small, Red, XS, L, etc.",
|
|
834
|
+
}
|
|
835
|
+
],
|
|
836
|
+
)
|
|
837
|
+
assert_matches_type(CheckoutIntent, checkout_intent, path=["response"])
|
|
838
|
+
|
|
839
|
+
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
840
|
+
@parametrize
|
|
841
|
+
async def test_raw_response_purchase(self, async_client: AsyncCheckoutIntents) -> None:
|
|
842
|
+
response = await async_client.checkout_intents.with_raw_response.purchase(
|
|
843
|
+
buyer={
|
|
844
|
+
"address1": "123 Main St",
|
|
845
|
+
"city": "New York",
|
|
846
|
+
"country": "US",
|
|
847
|
+
"email": "john.doe@example.com",
|
|
848
|
+
"first_name": "John",
|
|
849
|
+
"last_name": "Doe",
|
|
850
|
+
"phone": "1234567890",
|
|
851
|
+
"postal_code": "10001",
|
|
852
|
+
"province": "NY",
|
|
853
|
+
},
|
|
854
|
+
payment_method={
|
|
855
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
856
|
+
"type": "stripe_token",
|
|
857
|
+
},
|
|
858
|
+
product_url="productUrl",
|
|
859
|
+
quantity=1,
|
|
860
|
+
)
|
|
861
|
+
|
|
862
|
+
assert response.is_closed is True
|
|
863
|
+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
864
|
+
checkout_intent = await response.parse()
|
|
865
|
+
assert_matches_type(CheckoutIntent, checkout_intent, path=["response"])
|
|
866
|
+
|
|
867
|
+
@pytest.mark.skip(reason="Prism tests are disabled")
|
|
868
|
+
@parametrize
|
|
869
|
+
async def test_streaming_response_purchase(self, async_client: AsyncCheckoutIntents) -> None:
|
|
870
|
+
async with async_client.checkout_intents.with_streaming_response.purchase(
|
|
871
|
+
buyer={
|
|
872
|
+
"address1": "123 Main St",
|
|
873
|
+
"city": "New York",
|
|
874
|
+
"country": "US",
|
|
875
|
+
"email": "john.doe@example.com",
|
|
876
|
+
"first_name": "John",
|
|
877
|
+
"last_name": "Doe",
|
|
878
|
+
"phone": "1234567890",
|
|
879
|
+
"postal_code": "10001",
|
|
880
|
+
"province": "NY",
|
|
881
|
+
},
|
|
882
|
+
payment_method={
|
|
883
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
884
|
+
"type": "stripe_token",
|
|
885
|
+
},
|
|
886
|
+
product_url="productUrl",
|
|
887
|
+
quantity=1,
|
|
888
|
+
) as response:
|
|
889
|
+
assert not response.is_closed
|
|
890
|
+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
|
891
|
+
|
|
892
|
+
checkout_intent = await response.parse()
|
|
893
|
+
assert_matches_type(CheckoutIntent, checkout_intent, path=["response"])
|
|
894
|
+
|
|
895
|
+
assert cast(Any, response.is_closed) is True
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_datetime_parse.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_reflection.py
RENAMED
|
File without changes
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/_utils/_resources_proxy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/resources/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/base_checkout_intent.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/checkout_intent.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/payment_method.py
RENAMED
|
File without changes
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/payment_method_param.py
RENAMED
|
File without changes
|
{checkout_intents-0.5.0 → checkout_intents-0.7.0}/src/checkout_intents/types/variant_selection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|