checkout-intents 0.7.0__tar.gz → 0.9.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.9.0/.release-please-manifest.json +3 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/CHANGELOG.md +17 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/PKG-INFO +47 -11
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/README.md +46 -10
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/pyproject.toml +1 -1
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_version.py +1 -1
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/resources/checkout_intents.py +8 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/base_checkout_intent.py +9 -1
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/checkout_intent.py +2 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/checkout_intent_create_params.py +9 -1
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/checkout_intent_purchase_params.py +9 -1
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/api_resources/test_checkout_intents.py +16 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_client.py +64 -20
- checkout_intents-0.7.0/.release-please-manifest.json +0 -3
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/.gitignore +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/CONTRIBUTING.md +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/LICENSE +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/SECURITY.md +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/api.md +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/bin/check-release-environment +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/bin/publish-pypi +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/examples/.keep +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/examples/complete-checkout-intent.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/examples/error-handling.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/noxfile.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/release-please-config.json +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/requirements-dev.lock +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/requirements.lock +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/__init__.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_base_client.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_client.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_compat.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_constants.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_exceptions.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_files.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_models.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_qs.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_resource.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_response.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_streaming.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_types.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/__init__.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_compat.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_datetime_parse.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_logs.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_proxy.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_reflection.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_resources_proxy.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_streams.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_sync.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_transform.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_typing.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_utils.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/lib/.keep +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/pagination.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/py.typed +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/resources/__init__.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/resources/brands.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/__init__.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/brand_retrieve_response.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/buyer.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/buyer_param.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/checkout_intent_add_payment_params.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/checkout_intent_confirm_params.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/checkout_intent_list_params.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/money.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/offer.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/payment_method.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/payment_method_param.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/variant_selection.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/variant_selection_param.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/__init__.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/api_resources/__init__.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/api_resources/test_brands.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/conftest.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/sample_file.txt +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_deepcopy.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_environment_inference.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_extract_files.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_files.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_models.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_polling.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_qs.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_required_args.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_response.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_streaming.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_transform.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_utils/test_proxy.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/test_utils/test_typing.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/utils.py +0 -0
- {checkout_intents-0.7.0 → checkout_intents-0.9.0}/uv.lock +0 -0
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 (2025-12-25)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.8.0...v0.9.0](https://github.com/rye-com/checkout-intents-python/compare/v0.8.0...v0.9.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([dc735cc](https://github.com/rye-com/checkout-intents-python/commit/dc735ccb8a0eaf4c46ffe8dd984fa4efb111e5d4))
|
|
10
|
+
* **api:** swap featured request ([c42f14b](https://github.com/rye-com/checkout-intents-python/commit/c42f14b1bed4bf417bb2c289e8ba62962086271b))
|
|
11
|
+
|
|
12
|
+
## 0.8.0 (2025-12-25)
|
|
13
|
+
|
|
14
|
+
Full Changelog: [v0.7.0...v0.8.0](https://github.com/rye-com/checkout-intents-python/compare/v0.7.0...v0.8.0)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **api:** add support for purchase constraints ([6bfefb8](https://github.com/rye-com/checkout-intents-python/commit/6bfefb8494c05c7ea022f055e7b2644cf99de05e))
|
|
19
|
+
|
|
3
20
|
## 0.7.0 (2025-12-22)
|
|
4
21
|
|
|
5
22
|
Full Changelog: [v0.6.0...v0.7.0](https://github.com/rye-com/checkout-intents-python/compare/v0.6.0...v0.7.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: checkout-intents
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.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
|
|
@@ -69,7 +69,7 @@ client = CheckoutIntents(
|
|
|
69
69
|
environment="production",
|
|
70
70
|
)
|
|
71
71
|
|
|
72
|
-
checkout_intent = client.checkout_intents.
|
|
72
|
+
checkout_intent = client.checkout_intents.purchase(
|
|
73
73
|
buyer={
|
|
74
74
|
"address1": "123 Main St",
|
|
75
75
|
"city": "New York",
|
|
@@ -81,6 +81,10 @@ checkout_intent = client.checkout_intents.create(
|
|
|
81
81
|
"postal_code": "10001",
|
|
82
82
|
"province": "NY",
|
|
83
83
|
},
|
|
84
|
+
payment_method={
|
|
85
|
+
"stripe_token": "tok_visa",
|
|
86
|
+
"type": "stripe_token",
|
|
87
|
+
},
|
|
84
88
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
85
89
|
quantity=1,
|
|
86
90
|
)
|
|
@@ -200,7 +204,7 @@ client = AsyncCheckoutIntents(
|
|
|
200
204
|
|
|
201
205
|
|
|
202
206
|
async def main() -> None:
|
|
203
|
-
checkout_intent = await client.checkout_intents.
|
|
207
|
+
checkout_intent = await client.checkout_intents.purchase(
|
|
204
208
|
buyer={
|
|
205
209
|
"address1": "123 Main St",
|
|
206
210
|
"city": "New York",
|
|
@@ -212,6 +216,10 @@ async def main() -> None:
|
|
|
212
216
|
"postal_code": "10001",
|
|
213
217
|
"province": "NY",
|
|
214
218
|
},
|
|
219
|
+
payment_method={
|
|
220
|
+
"stripe_token": "tok_visa",
|
|
221
|
+
"type": "stripe_token",
|
|
222
|
+
},
|
|
215
223
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
216
224
|
quantity=1,
|
|
217
225
|
)
|
|
@@ -249,7 +257,7 @@ async def main() -> None:
|
|
|
249
257
|
), # This is the default and can be omitted
|
|
250
258
|
http_client=DefaultAioHttpClient(),
|
|
251
259
|
) as client:
|
|
252
|
-
checkout_intent = await client.checkout_intents.
|
|
260
|
+
checkout_intent = await client.checkout_intents.purchase(
|
|
253
261
|
buyer={
|
|
254
262
|
"address1": "123 Main St",
|
|
255
263
|
"city": "New York",
|
|
@@ -261,6 +269,10 @@ async def main() -> None:
|
|
|
261
269
|
"postal_code": "10001",
|
|
262
270
|
"province": "NY",
|
|
263
271
|
},
|
|
272
|
+
payment_method={
|
|
273
|
+
"stripe_token": "tok_visa",
|
|
274
|
+
"type": "stripe_token",
|
|
275
|
+
},
|
|
264
276
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
265
277
|
quantity=1,
|
|
266
278
|
)
|
|
@@ -358,7 +370,7 @@ from checkout_intents import CheckoutIntents
|
|
|
358
370
|
|
|
359
371
|
client = CheckoutIntents()
|
|
360
372
|
|
|
361
|
-
checkout_intent = client.checkout_intents.
|
|
373
|
+
checkout_intent = client.checkout_intents.purchase(
|
|
362
374
|
buyer={
|
|
363
375
|
"address1": "123 Main St",
|
|
364
376
|
"city": "New York",
|
|
@@ -370,6 +382,10 @@ checkout_intent = client.checkout_intents.create(
|
|
|
370
382
|
"postal_code": "10001",
|
|
371
383
|
"province": "NY",
|
|
372
384
|
},
|
|
385
|
+
payment_method={
|
|
386
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
387
|
+
"type": "stripe_token",
|
|
388
|
+
},
|
|
373
389
|
product_url="productUrl",
|
|
374
390
|
quantity=1,
|
|
375
391
|
)
|
|
@@ -392,7 +408,7 @@ from checkout_intents import CheckoutIntents
|
|
|
392
408
|
client = CheckoutIntents()
|
|
393
409
|
|
|
394
410
|
try:
|
|
395
|
-
client.checkout_intents.
|
|
411
|
+
client.checkout_intents.purchase(
|
|
396
412
|
buyer={
|
|
397
413
|
"address1": "123 Main St",
|
|
398
414
|
"city": "New York",
|
|
@@ -404,6 +420,10 @@ try:
|
|
|
404
420
|
"postal_code": "10001",
|
|
405
421
|
"province": "NY",
|
|
406
422
|
},
|
|
423
|
+
payment_method={
|
|
424
|
+
"stripe_token": "tok_visa",
|
|
425
|
+
"type": "stripe_token",
|
|
426
|
+
},
|
|
407
427
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
408
428
|
quantity=1,
|
|
409
429
|
)
|
|
@@ -469,7 +489,7 @@ client = CheckoutIntents(
|
|
|
469
489
|
)
|
|
470
490
|
|
|
471
491
|
# Or, configure per-request:
|
|
472
|
-
client.with_options(max_retries=5).checkout_intents.
|
|
492
|
+
client.with_options(max_retries=5).checkout_intents.purchase(
|
|
473
493
|
buyer={
|
|
474
494
|
"address1": "123 Main St",
|
|
475
495
|
"city": "New York",
|
|
@@ -481,6 +501,10 @@ client.with_options(max_retries=5).checkout_intents.create(
|
|
|
481
501
|
"postal_code": "10001",
|
|
482
502
|
"province": "NY",
|
|
483
503
|
},
|
|
504
|
+
payment_method={
|
|
505
|
+
"stripe_token": "tok_visa",
|
|
506
|
+
"type": "stripe_token",
|
|
507
|
+
},
|
|
484
508
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
485
509
|
quantity=1,
|
|
486
510
|
)
|
|
@@ -506,7 +530,7 @@ client = CheckoutIntents(
|
|
|
506
530
|
)
|
|
507
531
|
|
|
508
532
|
# Override per-request:
|
|
509
|
-
client.with_options(timeout=5.0).checkout_intents.
|
|
533
|
+
client.with_options(timeout=5.0).checkout_intents.purchase(
|
|
510
534
|
buyer={
|
|
511
535
|
"address1": "123 Main St",
|
|
512
536
|
"city": "New York",
|
|
@@ -518,6 +542,10 @@ client.with_options(timeout=5.0).checkout_intents.create(
|
|
|
518
542
|
"postal_code": "10001",
|
|
519
543
|
"province": "NY",
|
|
520
544
|
},
|
|
545
|
+
payment_method={
|
|
546
|
+
"stripe_token": "tok_visa",
|
|
547
|
+
"type": "stripe_token",
|
|
548
|
+
},
|
|
521
549
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
522
550
|
quantity=1,
|
|
523
551
|
)
|
|
@@ -561,7 +589,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
|
561
589
|
from checkout_intents import CheckoutIntents
|
|
562
590
|
|
|
563
591
|
client = CheckoutIntents()
|
|
564
|
-
response = client.checkout_intents.with_raw_response.
|
|
592
|
+
response = client.checkout_intents.with_raw_response.purchase(
|
|
565
593
|
buyer={
|
|
566
594
|
"address1": "123 Main St",
|
|
567
595
|
"city": "New York",
|
|
@@ -573,12 +601,16 @@ response = client.checkout_intents.with_raw_response.create(
|
|
|
573
601
|
"postal_code": "10001",
|
|
574
602
|
"province": "NY",
|
|
575
603
|
},
|
|
604
|
+
payment_method={
|
|
605
|
+
"stripe_token": "tok_visa",
|
|
606
|
+
"type": "stripe_token",
|
|
607
|
+
},
|
|
576
608
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
577
609
|
quantity=1,
|
|
578
610
|
)
|
|
579
611
|
print(response.headers.get('X-My-Header'))
|
|
580
612
|
|
|
581
|
-
checkout_intent = response.parse() # get the object that `checkout_intents.
|
|
613
|
+
checkout_intent = response.parse() # get the object that `checkout_intents.purchase()` would have returned
|
|
582
614
|
print(checkout_intent)
|
|
583
615
|
```
|
|
584
616
|
|
|
@@ -593,7 +625,7 @@ The above interface eagerly reads the full response body when you make the reque
|
|
|
593
625
|
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
|
|
594
626
|
|
|
595
627
|
```python
|
|
596
|
-
with client.checkout_intents.with_streaming_response.
|
|
628
|
+
with client.checkout_intents.with_streaming_response.purchase(
|
|
597
629
|
buyer={
|
|
598
630
|
"address1": "123 Main St",
|
|
599
631
|
"city": "New York",
|
|
@@ -605,6 +637,10 @@ with client.checkout_intents.with_streaming_response.create(
|
|
|
605
637
|
"postal_code": "10001",
|
|
606
638
|
"province": "NY",
|
|
607
639
|
},
|
|
640
|
+
payment_method={
|
|
641
|
+
"stripe_token": "tok_visa",
|
|
642
|
+
"type": "stripe_token",
|
|
643
|
+
},
|
|
608
644
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
609
645
|
quantity=1,
|
|
610
646
|
) as response:
|
|
@@ -34,7 +34,7 @@ client = CheckoutIntents(
|
|
|
34
34
|
environment="production",
|
|
35
35
|
)
|
|
36
36
|
|
|
37
|
-
checkout_intent = client.checkout_intents.
|
|
37
|
+
checkout_intent = client.checkout_intents.purchase(
|
|
38
38
|
buyer={
|
|
39
39
|
"address1": "123 Main St",
|
|
40
40
|
"city": "New York",
|
|
@@ -46,6 +46,10 @@ checkout_intent = client.checkout_intents.create(
|
|
|
46
46
|
"postal_code": "10001",
|
|
47
47
|
"province": "NY",
|
|
48
48
|
},
|
|
49
|
+
payment_method={
|
|
50
|
+
"stripe_token": "tok_visa",
|
|
51
|
+
"type": "stripe_token",
|
|
52
|
+
},
|
|
49
53
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
50
54
|
quantity=1,
|
|
51
55
|
)
|
|
@@ -165,7 +169,7 @@ client = AsyncCheckoutIntents(
|
|
|
165
169
|
|
|
166
170
|
|
|
167
171
|
async def main() -> None:
|
|
168
|
-
checkout_intent = await client.checkout_intents.
|
|
172
|
+
checkout_intent = await client.checkout_intents.purchase(
|
|
169
173
|
buyer={
|
|
170
174
|
"address1": "123 Main St",
|
|
171
175
|
"city": "New York",
|
|
@@ -177,6 +181,10 @@ async def main() -> None:
|
|
|
177
181
|
"postal_code": "10001",
|
|
178
182
|
"province": "NY",
|
|
179
183
|
},
|
|
184
|
+
payment_method={
|
|
185
|
+
"stripe_token": "tok_visa",
|
|
186
|
+
"type": "stripe_token",
|
|
187
|
+
},
|
|
180
188
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
181
189
|
quantity=1,
|
|
182
190
|
)
|
|
@@ -214,7 +222,7 @@ async def main() -> None:
|
|
|
214
222
|
), # This is the default and can be omitted
|
|
215
223
|
http_client=DefaultAioHttpClient(),
|
|
216
224
|
) as client:
|
|
217
|
-
checkout_intent = await client.checkout_intents.
|
|
225
|
+
checkout_intent = await client.checkout_intents.purchase(
|
|
218
226
|
buyer={
|
|
219
227
|
"address1": "123 Main St",
|
|
220
228
|
"city": "New York",
|
|
@@ -226,6 +234,10 @@ async def main() -> None:
|
|
|
226
234
|
"postal_code": "10001",
|
|
227
235
|
"province": "NY",
|
|
228
236
|
},
|
|
237
|
+
payment_method={
|
|
238
|
+
"stripe_token": "tok_visa",
|
|
239
|
+
"type": "stripe_token",
|
|
240
|
+
},
|
|
229
241
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
230
242
|
quantity=1,
|
|
231
243
|
)
|
|
@@ -323,7 +335,7 @@ from checkout_intents import CheckoutIntents
|
|
|
323
335
|
|
|
324
336
|
client = CheckoutIntents()
|
|
325
337
|
|
|
326
|
-
checkout_intent = client.checkout_intents.
|
|
338
|
+
checkout_intent = client.checkout_intents.purchase(
|
|
327
339
|
buyer={
|
|
328
340
|
"address1": "123 Main St",
|
|
329
341
|
"city": "New York",
|
|
@@ -335,6 +347,10 @@ checkout_intent = client.checkout_intents.create(
|
|
|
335
347
|
"postal_code": "10001",
|
|
336
348
|
"province": "NY",
|
|
337
349
|
},
|
|
350
|
+
payment_method={
|
|
351
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
352
|
+
"type": "stripe_token",
|
|
353
|
+
},
|
|
338
354
|
product_url="productUrl",
|
|
339
355
|
quantity=1,
|
|
340
356
|
)
|
|
@@ -357,7 +373,7 @@ from checkout_intents import CheckoutIntents
|
|
|
357
373
|
client = CheckoutIntents()
|
|
358
374
|
|
|
359
375
|
try:
|
|
360
|
-
client.checkout_intents.
|
|
376
|
+
client.checkout_intents.purchase(
|
|
361
377
|
buyer={
|
|
362
378
|
"address1": "123 Main St",
|
|
363
379
|
"city": "New York",
|
|
@@ -369,6 +385,10 @@ try:
|
|
|
369
385
|
"postal_code": "10001",
|
|
370
386
|
"province": "NY",
|
|
371
387
|
},
|
|
388
|
+
payment_method={
|
|
389
|
+
"stripe_token": "tok_visa",
|
|
390
|
+
"type": "stripe_token",
|
|
391
|
+
},
|
|
372
392
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
373
393
|
quantity=1,
|
|
374
394
|
)
|
|
@@ -434,7 +454,7 @@ client = CheckoutIntents(
|
|
|
434
454
|
)
|
|
435
455
|
|
|
436
456
|
# Or, configure per-request:
|
|
437
|
-
client.with_options(max_retries=5).checkout_intents.
|
|
457
|
+
client.with_options(max_retries=5).checkout_intents.purchase(
|
|
438
458
|
buyer={
|
|
439
459
|
"address1": "123 Main St",
|
|
440
460
|
"city": "New York",
|
|
@@ -446,6 +466,10 @@ client.with_options(max_retries=5).checkout_intents.create(
|
|
|
446
466
|
"postal_code": "10001",
|
|
447
467
|
"province": "NY",
|
|
448
468
|
},
|
|
469
|
+
payment_method={
|
|
470
|
+
"stripe_token": "tok_visa",
|
|
471
|
+
"type": "stripe_token",
|
|
472
|
+
},
|
|
449
473
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
450
474
|
quantity=1,
|
|
451
475
|
)
|
|
@@ -471,7 +495,7 @@ client = CheckoutIntents(
|
|
|
471
495
|
)
|
|
472
496
|
|
|
473
497
|
# Override per-request:
|
|
474
|
-
client.with_options(timeout=5.0).checkout_intents.
|
|
498
|
+
client.with_options(timeout=5.0).checkout_intents.purchase(
|
|
475
499
|
buyer={
|
|
476
500
|
"address1": "123 Main St",
|
|
477
501
|
"city": "New York",
|
|
@@ -483,6 +507,10 @@ client.with_options(timeout=5.0).checkout_intents.create(
|
|
|
483
507
|
"postal_code": "10001",
|
|
484
508
|
"province": "NY",
|
|
485
509
|
},
|
|
510
|
+
payment_method={
|
|
511
|
+
"stripe_token": "tok_visa",
|
|
512
|
+
"type": "stripe_token",
|
|
513
|
+
},
|
|
486
514
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
487
515
|
quantity=1,
|
|
488
516
|
)
|
|
@@ -526,7 +554,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
|
526
554
|
from checkout_intents import CheckoutIntents
|
|
527
555
|
|
|
528
556
|
client = CheckoutIntents()
|
|
529
|
-
response = client.checkout_intents.with_raw_response.
|
|
557
|
+
response = client.checkout_intents.with_raw_response.purchase(
|
|
530
558
|
buyer={
|
|
531
559
|
"address1": "123 Main St",
|
|
532
560
|
"city": "New York",
|
|
@@ -538,12 +566,16 @@ response = client.checkout_intents.with_raw_response.create(
|
|
|
538
566
|
"postal_code": "10001",
|
|
539
567
|
"province": "NY",
|
|
540
568
|
},
|
|
569
|
+
payment_method={
|
|
570
|
+
"stripe_token": "tok_visa",
|
|
571
|
+
"type": "stripe_token",
|
|
572
|
+
},
|
|
541
573
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
542
574
|
quantity=1,
|
|
543
575
|
)
|
|
544
576
|
print(response.headers.get('X-My-Header'))
|
|
545
577
|
|
|
546
|
-
checkout_intent = response.parse() # get the object that `checkout_intents.
|
|
578
|
+
checkout_intent = response.parse() # get the object that `checkout_intents.purchase()` would have returned
|
|
547
579
|
print(checkout_intent)
|
|
548
580
|
```
|
|
549
581
|
|
|
@@ -558,7 +590,7 @@ The above interface eagerly reads the full response body when you make the reque
|
|
|
558
590
|
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
|
|
559
591
|
|
|
560
592
|
```python
|
|
561
|
-
with client.checkout_intents.with_streaming_response.
|
|
593
|
+
with client.checkout_intents.with_streaming_response.purchase(
|
|
562
594
|
buyer={
|
|
563
595
|
"address1": "123 Main St",
|
|
564
596
|
"city": "New York",
|
|
@@ -570,6 +602,10 @@ with client.checkout_intents.with_streaming_response.create(
|
|
|
570
602
|
"postal_code": "10001",
|
|
571
603
|
"province": "NY",
|
|
572
604
|
},
|
|
605
|
+
payment_method={
|
|
606
|
+
"stripe_token": "tok_visa",
|
|
607
|
+
"type": "stripe_token",
|
|
608
|
+
},
|
|
573
609
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
574
610
|
quantity=1,
|
|
575
611
|
) as response:
|
{checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/resources/checkout_intents.py
RENAMED
|
@@ -71,6 +71,7 @@ class CheckoutIntentsResource(SyncAPIResource):
|
|
|
71
71
|
buyer: BuyerParam,
|
|
72
72
|
product_url: str,
|
|
73
73
|
quantity: float,
|
|
74
|
+
constraints: checkout_intent_create_params.Constraints | Omit = omit,
|
|
74
75
|
promo_codes: SequenceNotStr[str] | Omit = omit,
|
|
75
76
|
variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
|
|
76
77
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -101,6 +102,7 @@ class CheckoutIntentsResource(SyncAPIResource):
|
|
|
101
102
|
"buyer": buyer,
|
|
102
103
|
"product_url": product_url,
|
|
103
104
|
"quantity": quantity,
|
|
105
|
+
"constraints": constraints,
|
|
104
106
|
"promo_codes": promo_codes,
|
|
105
107
|
"variant_selections": variant_selections,
|
|
106
108
|
},
|
|
@@ -294,6 +296,7 @@ class CheckoutIntentsResource(SyncAPIResource):
|
|
|
294
296
|
buyer: BuyerParam,
|
|
295
297
|
product_url: str,
|
|
296
298
|
quantity: float,
|
|
299
|
+
constraints: checkout_intent_purchase_params.Constraints | Omit = omit,
|
|
297
300
|
promo_codes: SequenceNotStr[str] | Omit = omit,
|
|
298
301
|
variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
|
|
299
302
|
payment_method: PaymentMethodParam,
|
|
@@ -330,6 +333,7 @@ class CheckoutIntentsResource(SyncAPIResource):
|
|
|
330
333
|
"payment_method": payment_method,
|
|
331
334
|
"product_url": product_url,
|
|
332
335
|
"quantity": quantity,
|
|
336
|
+
"constraints": constraints,
|
|
333
337
|
"promo_codes": promo_codes,
|
|
334
338
|
"variant_selections": variant_selections,
|
|
335
339
|
},
|
|
@@ -728,6 +732,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
|
|
|
728
732
|
buyer: BuyerParam,
|
|
729
733
|
product_url: str,
|
|
730
734
|
quantity: float,
|
|
735
|
+
constraints: checkout_intent_create_params.Constraints | Omit = omit,
|
|
731
736
|
promo_codes: SequenceNotStr[str] | Omit = omit,
|
|
732
737
|
variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
|
|
733
738
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -758,6 +763,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
|
|
|
758
763
|
"buyer": buyer,
|
|
759
764
|
"product_url": product_url,
|
|
760
765
|
"quantity": quantity,
|
|
766
|
+
"constraints": constraints,
|
|
761
767
|
"promo_codes": promo_codes,
|
|
762
768
|
"variant_selections": variant_selections,
|
|
763
769
|
},
|
|
@@ -951,6 +957,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
|
|
|
951
957
|
buyer: BuyerParam,
|
|
952
958
|
product_url: str,
|
|
953
959
|
quantity: float,
|
|
960
|
+
constraints: checkout_intent_purchase_params.Constraints | Omit = omit,
|
|
954
961
|
promo_codes: SequenceNotStr[str] | Omit = omit,
|
|
955
962
|
variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
|
|
956
963
|
payment_method: PaymentMethodParam,
|
|
@@ -987,6 +994,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
|
|
|
987
994
|
"payment_method": payment_method,
|
|
988
995
|
"product_url": product_url,
|
|
989
996
|
"quantity": quantity,
|
|
997
|
+
"constraints": constraints,
|
|
990
998
|
"promo_codes": promo_codes,
|
|
991
999
|
"variant_selections": variant_selections,
|
|
992
1000
|
},
|
{checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/base_checkout_intent.py
RENAMED
|
@@ -9,7 +9,13 @@ from .buyer import Buyer
|
|
|
9
9
|
from .._models import BaseModel
|
|
10
10
|
from .variant_selection import VariantSelection
|
|
11
11
|
|
|
12
|
-
__all__ = ["BaseCheckoutIntent"]
|
|
12
|
+
__all__ = ["BaseCheckoutIntent", "Constraints"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Constraints(BaseModel):
|
|
16
|
+
max_shipping_price: Optional[int] = FieldInfo(alias="maxShippingPrice", default=None)
|
|
17
|
+
|
|
18
|
+
max_total_price: Optional[int] = FieldInfo(alias="maxTotalPrice", default=None)
|
|
13
19
|
|
|
14
20
|
|
|
15
21
|
class BaseCheckoutIntent(BaseModel):
|
|
@@ -23,6 +29,8 @@ class BaseCheckoutIntent(BaseModel):
|
|
|
23
29
|
|
|
24
30
|
quantity: float
|
|
25
31
|
|
|
32
|
+
constraints: Optional[Constraints] = None
|
|
33
|
+
|
|
26
34
|
promo_codes: Optional[List[str]] = FieldInfo(alias="promoCodes", default=None)
|
|
27
35
|
|
|
28
36
|
variant_selections: Optional[List[VariantSelection]] = FieldInfo(alias="variantSelections", default=None)
|
{checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/checkout_intent.py
RENAMED
|
@@ -71,6 +71,8 @@ class FailedCheckoutIntentFailureReason(BaseModel):
|
|
|
71
71
|
"form_validation_error",
|
|
72
72
|
"captcha_blocked",
|
|
73
73
|
"bot_protection_blocked",
|
|
74
|
+
"constraint_total_price_exceeded",
|
|
75
|
+
"constraint_shipping_cost_exceeded",
|
|
74
76
|
"unknown",
|
|
75
77
|
]
|
|
76
78
|
"""Type derived from runtime array - always in sync"""
|
|
@@ -10,7 +10,7 @@ from .._utils import PropertyInfo
|
|
|
10
10
|
from .buyer_param import BuyerParam
|
|
11
11
|
from .variant_selection_param import VariantSelectionParam
|
|
12
12
|
|
|
13
|
-
__all__ = ["CheckoutIntentCreateParams"]
|
|
13
|
+
__all__ = ["CheckoutIntentCreateParams", "Constraints"]
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class CheckoutIntentCreateParams(TypedDict, total=False):
|
|
@@ -20,6 +20,14 @@ class CheckoutIntentCreateParams(TypedDict, total=False):
|
|
|
20
20
|
|
|
21
21
|
quantity: Required[float]
|
|
22
22
|
|
|
23
|
+
constraints: Constraints
|
|
24
|
+
|
|
23
25
|
promo_codes: Annotated[SequenceNotStr[str], PropertyInfo(alias="promoCodes")]
|
|
24
26
|
|
|
25
27
|
variant_selections: Annotated[Iterable[VariantSelectionParam], PropertyInfo(alias="variantSelections")]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class Constraints(TypedDict, total=False):
|
|
31
|
+
max_shipping_price: Annotated[int, PropertyInfo(alias="maxShippingPrice")]
|
|
32
|
+
|
|
33
|
+
max_total_price: Annotated[int, PropertyInfo(alias="maxTotalPrice")]
|
|
@@ -11,7 +11,7 @@ from .buyer_param import BuyerParam
|
|
|
11
11
|
from .payment_method_param import PaymentMethodParam
|
|
12
12
|
from .variant_selection_param import VariantSelectionParam
|
|
13
13
|
|
|
14
|
-
__all__ = ["CheckoutIntentPurchaseParams"]
|
|
14
|
+
__all__ = ["CheckoutIntentPurchaseParams", "Constraints"]
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class CheckoutIntentPurchaseParams(TypedDict, total=False):
|
|
@@ -23,6 +23,14 @@ class CheckoutIntentPurchaseParams(TypedDict, total=False):
|
|
|
23
23
|
|
|
24
24
|
quantity: Required[float]
|
|
25
25
|
|
|
26
|
+
constraints: Constraints
|
|
27
|
+
|
|
26
28
|
promo_codes: Annotated[SequenceNotStr[str], PropertyInfo(alias="promoCodes")]
|
|
27
29
|
|
|
28
30
|
variant_selections: Annotated[Iterable[VariantSelectionParam], PropertyInfo(alias="variantSelections")]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Constraints(TypedDict, total=False):
|
|
34
|
+
max_shipping_price: Annotated[int, PropertyInfo(alias="maxShippingPrice")]
|
|
35
|
+
|
|
36
|
+
max_total_price: Annotated[int, PropertyInfo(alias="maxTotalPrice")]
|
{checkout_intents-0.7.0 → checkout_intents-0.9.0}/tests/api_resources/test_checkout_intents.py
RENAMED
|
@@ -58,6 +58,10 @@ class TestCheckoutIntents:
|
|
|
58
58
|
},
|
|
59
59
|
product_url="productUrl",
|
|
60
60
|
quantity=1,
|
|
61
|
+
constraints={
|
|
62
|
+
"max_shipping_price": 500,
|
|
63
|
+
"max_total_price": 100000,
|
|
64
|
+
},
|
|
61
65
|
promo_codes=["string"],
|
|
62
66
|
variant_selections=[
|
|
63
67
|
{
|
|
@@ -386,6 +390,10 @@ class TestCheckoutIntents:
|
|
|
386
390
|
},
|
|
387
391
|
product_url="productUrl",
|
|
388
392
|
quantity=1,
|
|
393
|
+
constraints={
|
|
394
|
+
"max_shipping_price": 500,
|
|
395
|
+
"max_total_price": 100000,
|
|
396
|
+
},
|
|
389
397
|
promo_codes=["string"],
|
|
390
398
|
variant_selections=[
|
|
391
399
|
{
|
|
@@ -498,6 +506,10 @@ class TestAsyncCheckoutIntents:
|
|
|
498
506
|
},
|
|
499
507
|
product_url="productUrl",
|
|
500
508
|
quantity=1,
|
|
509
|
+
constraints={
|
|
510
|
+
"max_shipping_price": 500,
|
|
511
|
+
"max_total_price": 100000,
|
|
512
|
+
},
|
|
501
513
|
promo_codes=["string"],
|
|
502
514
|
variant_selections=[
|
|
503
515
|
{
|
|
@@ -826,6 +838,10 @@ class TestAsyncCheckoutIntents:
|
|
|
826
838
|
},
|
|
827
839
|
product_url="productUrl",
|
|
828
840
|
quantity=1,
|
|
841
|
+
constraints={
|
|
842
|
+
"max_shipping_price": 500,
|
|
843
|
+
"max_total_price": 100000,
|
|
844
|
+
},
|
|
829
845
|
promo_codes=["string"],
|
|
830
846
|
variant_selections=[
|
|
831
847
|
{
|
|
@@ -763,10 +763,12 @@ class TestCheckoutIntents:
|
|
|
763
763
|
@mock.patch("checkout_intents._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
|
|
764
764
|
@pytest.mark.respx(base_url=base_url)
|
|
765
765
|
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: CheckoutIntents) -> None:
|
|
766
|
-
respx_mock.post("/api/v1/checkout-intents").mock(
|
|
766
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(
|
|
767
|
+
side_effect=httpx.TimeoutException("Test timeout error")
|
|
768
|
+
)
|
|
767
769
|
|
|
768
770
|
with pytest.raises(APITimeoutError):
|
|
769
|
-
client.checkout_intents.with_streaming_response.
|
|
771
|
+
client.checkout_intents.with_streaming_response.purchase(
|
|
770
772
|
buyer={
|
|
771
773
|
"address1": "123 Main St",
|
|
772
774
|
"city": "New York",
|
|
@@ -778,6 +780,10 @@ class TestCheckoutIntents:
|
|
|
778
780
|
"postal_code": "10001",
|
|
779
781
|
"province": "NY",
|
|
780
782
|
},
|
|
783
|
+
payment_method={
|
|
784
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
785
|
+
"type": "stripe_token",
|
|
786
|
+
},
|
|
781
787
|
product_url="productUrl",
|
|
782
788
|
quantity=1,
|
|
783
789
|
).__enter__()
|
|
@@ -787,10 +793,10 @@ class TestCheckoutIntents:
|
|
|
787
793
|
@mock.patch("checkout_intents._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
|
|
788
794
|
@pytest.mark.respx(base_url=base_url)
|
|
789
795
|
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: CheckoutIntents) -> None:
|
|
790
|
-
respx_mock.post("/api/v1/checkout-intents").mock(return_value=httpx.Response(500))
|
|
796
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(return_value=httpx.Response(500))
|
|
791
797
|
|
|
792
798
|
with pytest.raises(APIStatusError):
|
|
793
|
-
client.checkout_intents.with_streaming_response.
|
|
799
|
+
client.checkout_intents.with_streaming_response.purchase(
|
|
794
800
|
buyer={
|
|
795
801
|
"address1": "123 Main St",
|
|
796
802
|
"city": "New York",
|
|
@@ -802,6 +808,10 @@ class TestCheckoutIntents:
|
|
|
802
808
|
"postal_code": "10001",
|
|
803
809
|
"province": "NY",
|
|
804
810
|
},
|
|
811
|
+
payment_method={
|
|
812
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
813
|
+
"type": "stripe_token",
|
|
814
|
+
},
|
|
805
815
|
product_url="productUrl",
|
|
806
816
|
quantity=1,
|
|
807
817
|
).__enter__()
|
|
@@ -831,9 +841,9 @@ class TestCheckoutIntents:
|
|
|
831
841
|
return httpx.Response(500)
|
|
832
842
|
return httpx.Response(200)
|
|
833
843
|
|
|
834
|
-
respx_mock.post("/api/v1/checkout-intents").mock(side_effect=retry_handler)
|
|
844
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(side_effect=retry_handler)
|
|
835
845
|
|
|
836
|
-
response = client.checkout_intents.with_raw_response.
|
|
846
|
+
response = client.checkout_intents.with_raw_response.purchase(
|
|
837
847
|
buyer={
|
|
838
848
|
"address1": "123 Main St",
|
|
839
849
|
"city": "New York",
|
|
@@ -845,6 +855,10 @@ class TestCheckoutIntents:
|
|
|
845
855
|
"postal_code": "10001",
|
|
846
856
|
"province": "NY",
|
|
847
857
|
},
|
|
858
|
+
payment_method={
|
|
859
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
860
|
+
"type": "stripe_token",
|
|
861
|
+
},
|
|
848
862
|
product_url="productUrl",
|
|
849
863
|
quantity=1,
|
|
850
864
|
)
|
|
@@ -869,9 +883,9 @@ class TestCheckoutIntents:
|
|
|
869
883
|
return httpx.Response(500)
|
|
870
884
|
return httpx.Response(200)
|
|
871
885
|
|
|
872
|
-
respx_mock.post("/api/v1/checkout-intents").mock(side_effect=retry_handler)
|
|
886
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(side_effect=retry_handler)
|
|
873
887
|
|
|
874
|
-
response = client.checkout_intents.with_raw_response.
|
|
888
|
+
response = client.checkout_intents.with_raw_response.purchase(
|
|
875
889
|
buyer={
|
|
876
890
|
"address1": "123 Main St",
|
|
877
891
|
"city": "New York",
|
|
@@ -883,6 +897,10 @@ class TestCheckoutIntents:
|
|
|
883
897
|
"postal_code": "10001",
|
|
884
898
|
"province": "NY",
|
|
885
899
|
},
|
|
900
|
+
payment_method={
|
|
901
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
902
|
+
"type": "stripe_token",
|
|
903
|
+
},
|
|
886
904
|
product_url="productUrl",
|
|
887
905
|
quantity=1,
|
|
888
906
|
extra_headers={"x-stainless-retry-count": Omit()},
|
|
@@ -907,9 +925,9 @@ class TestCheckoutIntents:
|
|
|
907
925
|
return httpx.Response(500)
|
|
908
926
|
return httpx.Response(200)
|
|
909
927
|
|
|
910
|
-
respx_mock.post("/api/v1/checkout-intents").mock(side_effect=retry_handler)
|
|
928
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(side_effect=retry_handler)
|
|
911
929
|
|
|
912
|
-
response = client.checkout_intents.with_raw_response.
|
|
930
|
+
response = client.checkout_intents.with_raw_response.purchase(
|
|
913
931
|
buyer={
|
|
914
932
|
"address1": "123 Main St",
|
|
915
933
|
"city": "New York",
|
|
@@ -921,6 +939,10 @@ class TestCheckoutIntents:
|
|
|
921
939
|
"postal_code": "10001",
|
|
922
940
|
"province": "NY",
|
|
923
941
|
},
|
|
942
|
+
payment_method={
|
|
943
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
944
|
+
"type": "stripe_token",
|
|
945
|
+
},
|
|
924
946
|
product_url="productUrl",
|
|
925
947
|
quantity=1,
|
|
926
948
|
extra_headers={"x-stainless-retry-count": "42"},
|
|
@@ -1685,10 +1707,12 @@ class TestAsyncCheckoutIntents:
|
|
|
1685
1707
|
async def test_retrying_timeout_errors_doesnt_leak(
|
|
1686
1708
|
self, respx_mock: MockRouter, async_client: AsyncCheckoutIntents
|
|
1687
1709
|
) -> None:
|
|
1688
|
-
respx_mock.post("/api/v1/checkout-intents").mock(
|
|
1710
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(
|
|
1711
|
+
side_effect=httpx.TimeoutException("Test timeout error")
|
|
1712
|
+
)
|
|
1689
1713
|
|
|
1690
1714
|
with pytest.raises(APITimeoutError):
|
|
1691
|
-
await async_client.checkout_intents.with_streaming_response.
|
|
1715
|
+
await async_client.checkout_intents.with_streaming_response.purchase(
|
|
1692
1716
|
buyer={
|
|
1693
1717
|
"address1": "123 Main St",
|
|
1694
1718
|
"city": "New York",
|
|
@@ -1700,6 +1724,10 @@ class TestAsyncCheckoutIntents:
|
|
|
1700
1724
|
"postal_code": "10001",
|
|
1701
1725
|
"province": "NY",
|
|
1702
1726
|
},
|
|
1727
|
+
payment_method={
|
|
1728
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
1729
|
+
"type": "stripe_token",
|
|
1730
|
+
},
|
|
1703
1731
|
product_url="productUrl",
|
|
1704
1732
|
quantity=1,
|
|
1705
1733
|
).__aenter__()
|
|
@@ -1711,10 +1739,10 @@ class TestAsyncCheckoutIntents:
|
|
|
1711
1739
|
async def test_retrying_status_errors_doesnt_leak(
|
|
1712
1740
|
self, respx_mock: MockRouter, async_client: AsyncCheckoutIntents
|
|
1713
1741
|
) -> None:
|
|
1714
|
-
respx_mock.post("/api/v1/checkout-intents").mock(return_value=httpx.Response(500))
|
|
1742
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(return_value=httpx.Response(500))
|
|
1715
1743
|
|
|
1716
1744
|
with pytest.raises(APIStatusError):
|
|
1717
|
-
await async_client.checkout_intents.with_streaming_response.
|
|
1745
|
+
await async_client.checkout_intents.with_streaming_response.purchase(
|
|
1718
1746
|
buyer={
|
|
1719
1747
|
"address1": "123 Main St",
|
|
1720
1748
|
"city": "New York",
|
|
@@ -1726,6 +1754,10 @@ class TestAsyncCheckoutIntents:
|
|
|
1726
1754
|
"postal_code": "10001",
|
|
1727
1755
|
"province": "NY",
|
|
1728
1756
|
},
|
|
1757
|
+
payment_method={
|
|
1758
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
1759
|
+
"type": "stripe_token",
|
|
1760
|
+
},
|
|
1729
1761
|
product_url="productUrl",
|
|
1730
1762
|
quantity=1,
|
|
1731
1763
|
).__aenter__()
|
|
@@ -1755,9 +1787,9 @@ class TestAsyncCheckoutIntents:
|
|
|
1755
1787
|
return httpx.Response(500)
|
|
1756
1788
|
return httpx.Response(200)
|
|
1757
1789
|
|
|
1758
|
-
respx_mock.post("/api/v1/checkout-intents").mock(side_effect=retry_handler)
|
|
1790
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(side_effect=retry_handler)
|
|
1759
1791
|
|
|
1760
|
-
response = await client.checkout_intents.with_raw_response.
|
|
1792
|
+
response = await client.checkout_intents.with_raw_response.purchase(
|
|
1761
1793
|
buyer={
|
|
1762
1794
|
"address1": "123 Main St",
|
|
1763
1795
|
"city": "New York",
|
|
@@ -1769,6 +1801,10 @@ class TestAsyncCheckoutIntents:
|
|
|
1769
1801
|
"postal_code": "10001",
|
|
1770
1802
|
"province": "NY",
|
|
1771
1803
|
},
|
|
1804
|
+
payment_method={
|
|
1805
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
1806
|
+
"type": "stripe_token",
|
|
1807
|
+
},
|
|
1772
1808
|
product_url="productUrl",
|
|
1773
1809
|
quantity=1,
|
|
1774
1810
|
)
|
|
@@ -1793,9 +1829,9 @@ class TestAsyncCheckoutIntents:
|
|
|
1793
1829
|
return httpx.Response(500)
|
|
1794
1830
|
return httpx.Response(200)
|
|
1795
1831
|
|
|
1796
|
-
respx_mock.post("/api/v1/checkout-intents").mock(side_effect=retry_handler)
|
|
1832
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(side_effect=retry_handler)
|
|
1797
1833
|
|
|
1798
|
-
response = await client.checkout_intents.with_raw_response.
|
|
1834
|
+
response = await client.checkout_intents.with_raw_response.purchase(
|
|
1799
1835
|
buyer={
|
|
1800
1836
|
"address1": "123 Main St",
|
|
1801
1837
|
"city": "New York",
|
|
@@ -1807,6 +1843,10 @@ class TestAsyncCheckoutIntents:
|
|
|
1807
1843
|
"postal_code": "10001",
|
|
1808
1844
|
"province": "NY",
|
|
1809
1845
|
},
|
|
1846
|
+
payment_method={
|
|
1847
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
1848
|
+
"type": "stripe_token",
|
|
1849
|
+
},
|
|
1810
1850
|
product_url="productUrl",
|
|
1811
1851
|
quantity=1,
|
|
1812
1852
|
extra_headers={"x-stainless-retry-count": Omit()},
|
|
@@ -1831,9 +1871,9 @@ class TestAsyncCheckoutIntents:
|
|
|
1831
1871
|
return httpx.Response(500)
|
|
1832
1872
|
return httpx.Response(200)
|
|
1833
1873
|
|
|
1834
|
-
respx_mock.post("/api/v1/checkout-intents").mock(side_effect=retry_handler)
|
|
1874
|
+
respx_mock.post("/api/v1/checkout-intents/purchase").mock(side_effect=retry_handler)
|
|
1835
1875
|
|
|
1836
|
-
response = await client.checkout_intents.with_raw_response.
|
|
1876
|
+
response = await client.checkout_intents.with_raw_response.purchase(
|
|
1837
1877
|
buyer={
|
|
1838
1878
|
"address1": "123 Main St",
|
|
1839
1879
|
"city": "New York",
|
|
@@ -1845,6 +1885,10 @@ class TestAsyncCheckoutIntents:
|
|
|
1845
1885
|
"postal_code": "10001",
|
|
1846
1886
|
"province": "NY",
|
|
1847
1887
|
},
|
|
1888
|
+
payment_method={
|
|
1889
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
1890
|
+
"type": "stripe_token",
|
|
1891
|
+
},
|
|
1848
1892
|
product_url="productUrl",
|
|
1849
1893
|
quantity=1,
|
|
1850
1894
|
extra_headers={"x-stainless-retry-count": "42"},
|
|
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.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_datetime_parse.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/_utils/_reflection.py
RENAMED
|
File without changes
|
{checkout_intents-0.7.0 → checkout_intents-0.9.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.7.0 → checkout_intents-0.9.0}/src/checkout_intents/resources/__init__.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
|
{checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/payment_method.py
RENAMED
|
File without changes
|
{checkout_intents-0.7.0 → checkout_intents-0.9.0}/src/checkout_intents/types/payment_method_param.py
RENAMED
|
File without changes
|
{checkout_intents-0.7.0 → checkout_intents-0.9.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
|