dodopayments 1.49.0__py3-none-any.whl → 1.51.1__py3-none-any.whl
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.
- dodopayments/_client.py +15 -11
- dodopayments/_models.py +1 -1
- dodopayments/_types.py +35 -1
- dodopayments/_utils/__init__.py +1 -0
- dodopayments/_utils/_typing.py +5 -0
- dodopayments/_version.py +1 -1
- dodopayments/resources/__init__.py +13 -13
- dodopayments/resources/checkout_sessions.py +272 -0
- dodopayments/resources/subscriptions.py +7 -2
- dodopayments/resources/webhooks/webhooks.py +19 -22
- dodopayments/types/__init__.py +4 -13
- dodopayments/types/checkout_session_create_params.py +174 -0
- dodopayments/types/checkout_session_response.py +13 -0
- dodopayments/types/on_demand_subscription_param.py +44 -0
- dodopayments/types/subscription.py +3 -0
- dodopayments/types/subscription_create_params.py +3 -36
- dodopayments/types/subscription_update_params.py +1 -0
- dodopayments/types/{webhook_list_response.py → webhook_details.py} +2 -2
- {dodopayments-1.49.0.dist-info → dodopayments-1.51.1.dist-info}/METADATA +17 -90
- {dodopayments-1.49.0.dist-info → dodopayments-1.51.1.dist-info}/RECORD +22 -31
- dodopayments/resources/your_webhook_url.py +0 -224
- dodopayments/types/addon_cart_response_item_param.py +0 -13
- dodopayments/types/customer_limited_details_param.py +0 -18
- dodopayments/types/dispute_param.py +0 -45
- dodopayments/types/get_dispute_param.py +0 -52
- dodopayments/types/license_key_param.py +0 -53
- dodopayments/types/payment_param.py +0 -131
- dodopayments/types/refund_param.py +0 -42
- dodopayments/types/subscription_param.py +0 -97
- dodopayments/types/webhook_create_response.py +0 -42
- dodopayments/types/webhook_retrieve_response.py +0 -42
- dodopayments/types/webhook_update_response.py +0 -42
- dodopayments/types/your_webhook_url_create_params.py +0 -66
- {dodopayments-1.49.0.dist-info → dodopayments-1.51.1.dist-info}/WHEEL +0 -0
- {dodopayments-1.49.0.dist-info → dodopayments-1.51.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -27,11 +27,8 @@ from ..._response import (
|
|
|
27
27
|
)
|
|
28
28
|
from ...pagination import SyncCursorPagePagination, AsyncCursorPagePagination
|
|
29
29
|
from ..._base_client import AsyncPaginator, make_request_options
|
|
30
|
+
from ...types.webhook_details import WebhookDetails
|
|
30
31
|
from ...types.webhook_event_type import WebhookEventType
|
|
31
|
-
from ...types.webhook_list_response import WebhookListResponse
|
|
32
|
-
from ...types.webhook_create_response import WebhookCreateResponse
|
|
33
|
-
from ...types.webhook_update_response import WebhookUpdateResponse
|
|
34
|
-
from ...types.webhook_retrieve_response import WebhookRetrieveResponse
|
|
35
32
|
from ...types.webhook_retrieve_secret_response import WebhookRetrieveSecretResponse
|
|
36
33
|
|
|
37
34
|
__all__ = ["WebhooksResource", "AsyncWebhooksResource"]
|
|
@@ -78,7 +75,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
78
75
|
extra_query: Query | None = None,
|
|
79
76
|
extra_body: Body | None = None,
|
|
80
77
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
81
|
-
) ->
|
|
78
|
+
) -> WebhookDetails:
|
|
82
79
|
"""
|
|
83
80
|
Create a new webhook
|
|
84
81
|
|
|
@@ -125,7 +122,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
125
122
|
options=make_request_options(
|
|
126
123
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
127
124
|
),
|
|
128
|
-
cast_to=
|
|
125
|
+
cast_to=WebhookDetails,
|
|
129
126
|
)
|
|
130
127
|
|
|
131
128
|
def retrieve(
|
|
@@ -138,7 +135,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
138
135
|
extra_query: Query | None = None,
|
|
139
136
|
extra_body: Body | None = None,
|
|
140
137
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
141
|
-
) ->
|
|
138
|
+
) -> WebhookDetails:
|
|
142
139
|
"""
|
|
143
140
|
Get a webhook by id
|
|
144
141
|
|
|
@@ -158,7 +155,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
158
155
|
options=make_request_options(
|
|
159
156
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
160
157
|
),
|
|
161
|
-
cast_to=
|
|
158
|
+
cast_to=WebhookDetails,
|
|
162
159
|
)
|
|
163
160
|
|
|
164
161
|
def update(
|
|
@@ -177,7 +174,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
177
174
|
extra_query: Query | None = None,
|
|
178
175
|
extra_body: Body | None = None,
|
|
179
176
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
180
|
-
) ->
|
|
177
|
+
) -> WebhookDetails:
|
|
181
178
|
"""
|
|
182
179
|
Patch a webhook by id
|
|
183
180
|
|
|
@@ -222,7 +219,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
222
219
|
options=make_request_options(
|
|
223
220
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
224
221
|
),
|
|
225
|
-
cast_to=
|
|
222
|
+
cast_to=WebhookDetails,
|
|
226
223
|
)
|
|
227
224
|
|
|
228
225
|
def list(
|
|
@@ -236,7 +233,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
236
233
|
extra_query: Query | None = None,
|
|
237
234
|
extra_body: Body | None = None,
|
|
238
235
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
239
|
-
) -> SyncCursorPagePagination[
|
|
236
|
+
) -> SyncCursorPagePagination[WebhookDetails]:
|
|
240
237
|
"""
|
|
241
238
|
List all webhooks
|
|
242
239
|
|
|
@@ -255,7 +252,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
255
252
|
"""
|
|
256
253
|
return self._get_api_list(
|
|
257
254
|
"/webhooks",
|
|
258
|
-
page=SyncCursorPagePagination[
|
|
255
|
+
page=SyncCursorPagePagination[WebhookDetails],
|
|
259
256
|
options=make_request_options(
|
|
260
257
|
extra_headers=extra_headers,
|
|
261
258
|
extra_query=extra_query,
|
|
@@ -269,7 +266,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
269
266
|
webhook_list_params.WebhookListParams,
|
|
270
267
|
),
|
|
271
268
|
),
|
|
272
|
-
model=
|
|
269
|
+
model=WebhookDetails,
|
|
273
270
|
)
|
|
274
271
|
|
|
275
272
|
def delete(
|
|
@@ -381,7 +378,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
381
378
|
extra_query: Query | None = None,
|
|
382
379
|
extra_body: Body | None = None,
|
|
383
380
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
384
|
-
) ->
|
|
381
|
+
) -> WebhookDetails:
|
|
385
382
|
"""
|
|
386
383
|
Create a new webhook
|
|
387
384
|
|
|
@@ -428,7 +425,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
428
425
|
options=make_request_options(
|
|
429
426
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
430
427
|
),
|
|
431
|
-
cast_to=
|
|
428
|
+
cast_to=WebhookDetails,
|
|
432
429
|
)
|
|
433
430
|
|
|
434
431
|
async def retrieve(
|
|
@@ -441,7 +438,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
441
438
|
extra_query: Query | None = None,
|
|
442
439
|
extra_body: Body | None = None,
|
|
443
440
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
444
|
-
) ->
|
|
441
|
+
) -> WebhookDetails:
|
|
445
442
|
"""
|
|
446
443
|
Get a webhook by id
|
|
447
444
|
|
|
@@ -461,7 +458,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
461
458
|
options=make_request_options(
|
|
462
459
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
463
460
|
),
|
|
464
|
-
cast_to=
|
|
461
|
+
cast_to=WebhookDetails,
|
|
465
462
|
)
|
|
466
463
|
|
|
467
464
|
async def update(
|
|
@@ -480,7 +477,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
480
477
|
extra_query: Query | None = None,
|
|
481
478
|
extra_body: Body | None = None,
|
|
482
479
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
483
|
-
) ->
|
|
480
|
+
) -> WebhookDetails:
|
|
484
481
|
"""
|
|
485
482
|
Patch a webhook by id
|
|
486
483
|
|
|
@@ -525,7 +522,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
525
522
|
options=make_request_options(
|
|
526
523
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
527
524
|
),
|
|
528
|
-
cast_to=
|
|
525
|
+
cast_to=WebhookDetails,
|
|
529
526
|
)
|
|
530
527
|
|
|
531
528
|
def list(
|
|
@@ -539,7 +536,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
539
536
|
extra_query: Query | None = None,
|
|
540
537
|
extra_body: Body | None = None,
|
|
541
538
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
542
|
-
) -> AsyncPaginator[
|
|
539
|
+
) -> AsyncPaginator[WebhookDetails, AsyncCursorPagePagination[WebhookDetails]]:
|
|
543
540
|
"""
|
|
544
541
|
List all webhooks
|
|
545
542
|
|
|
@@ -558,7 +555,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
558
555
|
"""
|
|
559
556
|
return self._get_api_list(
|
|
560
557
|
"/webhooks",
|
|
561
|
-
page=AsyncCursorPagePagination[
|
|
558
|
+
page=AsyncCursorPagePagination[WebhookDetails],
|
|
562
559
|
options=make_request_options(
|
|
563
560
|
extra_headers=extra_headers,
|
|
564
561
|
extra_query=extra_query,
|
|
@@ -572,7 +569,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
572
569
|
webhook_list_params.WebhookListParams,
|
|
573
570
|
),
|
|
574
571
|
),
|
|
575
|
-
model=
|
|
572
|
+
model=WebhookDetails,
|
|
576
573
|
)
|
|
577
574
|
|
|
578
575
|
async def delete(
|
dodopayments/types/__init__.py
CHANGED
|
@@ -15,28 +15,23 @@ from .get_dispute import GetDispute as GetDispute
|
|
|
15
15
|
from .license_key import LicenseKey as LicenseKey
|
|
16
16
|
from .price_param import PriceParam as PriceParam
|
|
17
17
|
from .country_code import CountryCode as CountryCode
|
|
18
|
-
from .refund_param import RefundParam as RefundParam
|
|
19
18
|
from .subscription import Subscription as Subscription
|
|
20
19
|
from .tax_category import TaxCategory as TaxCategory
|
|
21
20
|
from .discount_type import DiscountType as DiscountType
|
|
22
|
-
from .dispute_param import DisputeParam as DisputeParam
|
|
23
21
|
from .dispute_stage import DisputeStage as DisputeStage
|
|
24
22
|
from .intent_status import IntentStatus as IntentStatus
|
|
25
|
-
from .payment_param import PaymentParam as PaymentParam
|
|
26
23
|
from .refund_status import RefundStatus as RefundStatus
|
|
27
24
|
from .time_interval import TimeInterval as TimeInterval
|
|
28
25
|
from .addon_response import AddonResponse as AddonResponse
|
|
29
26
|
from .dispute_status import DisputeStatus as DisputeStatus
|
|
30
27
|
from .billing_address import BillingAddress as BillingAddress
|
|
28
|
+
from .webhook_details import WebhookDetails as WebhookDetails
|
|
31
29
|
from .addon_list_params import AddonListParams as AddonListParams
|
|
32
|
-
from .get_dispute_param import GetDisputeParam as GetDisputeParam
|
|
33
|
-
from .license_key_param import LicenseKeyParam as LicenseKeyParam
|
|
34
30
|
from .attach_addon_param import AttachAddonParam as AttachAddonParam
|
|
35
31
|
from .license_key_status import LicenseKeyStatus as LicenseKeyStatus
|
|
36
32
|
from .new_customer_param import NewCustomerParam as NewCustomerParam
|
|
37
33
|
from .payout_list_params import PayoutListParams as PayoutListParams
|
|
38
34
|
from .refund_list_params import RefundListParams as RefundListParams
|
|
39
|
-
from .subscription_param import SubscriptionParam as SubscriptionParam
|
|
40
35
|
from .webhook_event_type import WebhookEventType as WebhookEventType
|
|
41
36
|
from .addon_create_params import AddonCreateParams as AddonCreateParams
|
|
42
37
|
from .addon_update_params import AddonUpdateParams as AddonUpdateParams
|
|
@@ -63,7 +58,6 @@ from .product_create_params import ProductCreateParams as ProductCreateParams
|
|
|
63
58
|
from .product_list_response import ProductListResponse as ProductListResponse
|
|
64
59
|
from .product_update_params import ProductUpdateParams as ProductUpdateParams
|
|
65
60
|
from .webhook_create_params import WebhookCreateParams as WebhookCreateParams
|
|
66
|
-
from .webhook_list_response import WebhookListResponse as WebhookListResponse
|
|
67
61
|
from .webhook_update_params import WebhookUpdateParams as WebhookUpdateParams
|
|
68
62
|
from .customer_create_params import CustomerCreateParams as CustomerCreateParams
|
|
69
63
|
from .customer_request_param import CustomerRequestParam as CustomerRequestParam
|
|
@@ -75,15 +69,13 @@ from .license_activate_params import LicenseActivateParams as LicenseActivatePar
|
|
|
75
69
|
from .license_key_list_params import LicenseKeyListParams as LicenseKeyListParams
|
|
76
70
|
from .license_validate_params import LicenseValidateParams as LicenseValidateParams
|
|
77
71
|
from .payment_create_response import PaymentCreateResponse as PaymentCreateResponse
|
|
78
|
-
from .webhook_create_response import WebhookCreateResponse as WebhookCreateResponse
|
|
79
|
-
from .webhook_update_response import WebhookUpdateResponse as WebhookUpdateResponse
|
|
80
72
|
from .addon_cart_response_item import AddonCartResponseItem as AddonCartResponseItem
|
|
81
73
|
from .customer_limited_details import CustomerLimitedDetails as CustomerLimitedDetails
|
|
82
74
|
from .subscription_list_params import SubscriptionListParams as SubscriptionListParams
|
|
75
|
+
from .checkout_session_response import CheckoutSessionResponse as CheckoutSessionResponse
|
|
83
76
|
from .license_deactivate_params import LicenseDeactivateParams as LicenseDeactivateParams
|
|
84
77
|
from .license_key_update_params import LicenseKeyUpdateParams as LicenseKeyUpdateParams
|
|
85
78
|
from .license_validate_response import LicenseValidateResponse as LicenseValidateResponse
|
|
86
|
-
from .webhook_retrieve_response import WebhookRetrieveResponse as WebhookRetrieveResponse
|
|
87
79
|
from .license_key_duration_param import LicenseKeyDurationParam as LicenseKeyDurationParam
|
|
88
80
|
from .one_time_product_cart_item import OneTimeProductCartItem as OneTimeProductCartItem
|
|
89
81
|
from .subscription_charge_params import SubscriptionChargeParams as SubscriptionChargeParams
|
|
@@ -93,13 +85,12 @@ from .subscription_update_params import SubscriptionUpdateParams as Subscription
|
|
|
93
85
|
from .product_update_files_params import ProductUpdateFilesParams as ProductUpdateFilesParams
|
|
94
86
|
from .addon_update_images_response import AddonUpdateImagesResponse as AddonUpdateImagesResponse
|
|
95
87
|
from .brand_update_images_response import BrandUpdateImagesResponse as BrandUpdateImagesResponse
|
|
88
|
+
from .on_demand_subscription_param import OnDemandSubscriptionParam as OnDemandSubscriptionParam
|
|
96
89
|
from .subscription_charge_response import SubscriptionChargeResponse as SubscriptionChargeResponse
|
|
97
90
|
from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse
|
|
98
91
|
from .product_update_files_response import ProductUpdateFilesResponse as ProductUpdateFilesResponse
|
|
99
|
-
from .addon_cart_response_item_param import AddonCartResponseItemParam as AddonCartResponseItemParam
|
|
100
92
|
from .attach_existing_customer_param import AttachExistingCustomerParam as AttachExistingCustomerParam
|
|
101
|
-
from .
|
|
102
|
-
from .your_webhook_url_create_params import YourWebhookURLCreateParams as YourWebhookURLCreateParams
|
|
93
|
+
from .checkout_session_create_params import CheckoutSessionCreateParams as CheckoutSessionCreateParams
|
|
103
94
|
from .subscription_change_plan_params import SubscriptionChangePlanParams as SubscriptionChangePlanParams
|
|
104
95
|
from .license_key_instance_list_params import LicenseKeyInstanceListParams as LicenseKeyInstanceListParams
|
|
105
96
|
from .one_time_product_cart_item_param import OneTimeProductCartItemParam as OneTimeProductCartItemParam
|
|
@@ -0,0 +1,174 @@
|
|
|
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 Dict, List, Iterable, Optional
|
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from .currency import Currency
|
|
9
|
+
from .country_code import CountryCode
|
|
10
|
+
from .attach_addon_param import AttachAddonParam
|
|
11
|
+
from .payment_method_types import PaymentMethodTypes
|
|
12
|
+
from .customer_request_param import CustomerRequestParam
|
|
13
|
+
from .on_demand_subscription_param import OnDemandSubscriptionParam
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"CheckoutSessionCreateParams",
|
|
17
|
+
"ProductCart",
|
|
18
|
+
"BillingAddress",
|
|
19
|
+
"Customization",
|
|
20
|
+
"FeatureFlags",
|
|
21
|
+
"SubscriptionData",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class CheckoutSessionCreateParams(TypedDict, total=False):
|
|
26
|
+
product_cart: Required[Iterable[ProductCart]]
|
|
27
|
+
|
|
28
|
+
allowed_payment_method_types: Optional[List[PaymentMethodTypes]]
|
|
29
|
+
"""
|
|
30
|
+
Customers will never see payment methods that are not in this list. However,
|
|
31
|
+
adding a method here does not guarantee customers will see it. Availability
|
|
32
|
+
still depends on other factors (e.g., customer location, merchant settings).
|
|
33
|
+
|
|
34
|
+
Disclaimar: Always provide 'credit' and 'debit' as a fallback. If all payment
|
|
35
|
+
methods are unavailable, checkout session will fail.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
billing_address: Optional[BillingAddress]
|
|
39
|
+
"""Billing address information for the session"""
|
|
40
|
+
|
|
41
|
+
billing_currency: Optional[Currency]
|
|
42
|
+
"""This field is ingored if adaptive pricing is disabled"""
|
|
43
|
+
|
|
44
|
+
confirm: bool
|
|
45
|
+
"""If confirm is true, all the details will be finalized.
|
|
46
|
+
|
|
47
|
+
If required data is missing, an API error is thrown.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
customer: Optional[CustomerRequestParam]
|
|
51
|
+
"""Customer details for the session"""
|
|
52
|
+
|
|
53
|
+
customization: Customization
|
|
54
|
+
"""Customization for the checkout session page"""
|
|
55
|
+
|
|
56
|
+
discount_code: Optional[str]
|
|
57
|
+
|
|
58
|
+
feature_flags: FeatureFlags
|
|
59
|
+
|
|
60
|
+
metadata: Optional[Dict[str, str]]
|
|
61
|
+
"""Additional metadata associated with the payment.
|
|
62
|
+
|
|
63
|
+
Defaults to empty if not provided.
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
return_url: Optional[str]
|
|
67
|
+
"""The url to redirect after payment failure or success."""
|
|
68
|
+
|
|
69
|
+
show_saved_payment_methods: bool
|
|
70
|
+
"""Display saved payment methods of a returning customer False by default"""
|
|
71
|
+
|
|
72
|
+
subscription_data: Optional[SubscriptionData]
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class ProductCart(TypedDict, total=False):
|
|
76
|
+
product_id: Required[str]
|
|
77
|
+
"""unique id of the product"""
|
|
78
|
+
|
|
79
|
+
quantity: Required[int]
|
|
80
|
+
|
|
81
|
+
addons: Optional[Iterable[AttachAddonParam]]
|
|
82
|
+
"""only valid if product is a subscription"""
|
|
83
|
+
|
|
84
|
+
amount: Optional[int]
|
|
85
|
+
"""Amount the customer pays if pay_what_you_want is enabled.
|
|
86
|
+
|
|
87
|
+
If disabled then amount will be ignored Represented in the lowest denomination
|
|
88
|
+
of the currency (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
|
89
|
+
Only applicable for one time payments
|
|
90
|
+
|
|
91
|
+
If amount is not set for pay_what_you_want product, customer is allowed to
|
|
92
|
+
select the amount.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class BillingAddress(TypedDict, total=False):
|
|
97
|
+
country: Required[CountryCode]
|
|
98
|
+
"""Two-letter ISO country code (ISO 3166-1 alpha-2)"""
|
|
99
|
+
|
|
100
|
+
city: Optional[str]
|
|
101
|
+
"""City name"""
|
|
102
|
+
|
|
103
|
+
state: Optional[str]
|
|
104
|
+
"""State or province name"""
|
|
105
|
+
|
|
106
|
+
street: Optional[str]
|
|
107
|
+
"""Street address including house number and unit/apartment if applicable"""
|
|
108
|
+
|
|
109
|
+
zipcode: Optional[str]
|
|
110
|
+
"""Postal code or ZIP code"""
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class Customization(TypedDict, total=False):
|
|
114
|
+
show_on_demand_tag: bool
|
|
115
|
+
"""Show on demand tag
|
|
116
|
+
|
|
117
|
+
Default is true
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
show_order_details: bool
|
|
121
|
+
"""Show order details by default
|
|
122
|
+
|
|
123
|
+
Default is true
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
theme: Literal["dark", "light", "system"]
|
|
127
|
+
"""Theme of the page
|
|
128
|
+
|
|
129
|
+
Default is `System`.
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
class FeatureFlags(TypedDict, total=False):
|
|
134
|
+
allow_currency_selection: bool
|
|
135
|
+
"""if customer is allowed to change currency, set it to true
|
|
136
|
+
|
|
137
|
+
Default is true
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
allow_discount_code: bool
|
|
141
|
+
"""If the customer is allowed to apply discount code, set it to true.
|
|
142
|
+
|
|
143
|
+
Default is true
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
allow_phone_number_collection: bool
|
|
147
|
+
"""If phone number is collected from customer, set it to rue
|
|
148
|
+
|
|
149
|
+
Default is true
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
allow_tax_id: bool
|
|
153
|
+
"""If the customer is allowed to add tax id, set it to true
|
|
154
|
+
|
|
155
|
+
Default is true
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
always_create_new_customer: bool
|
|
159
|
+
"""
|
|
160
|
+
Set to true if a new customer object should be created. By default email is used
|
|
161
|
+
to find an existing customer to attach the session to
|
|
162
|
+
|
|
163
|
+
Default is false
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class SubscriptionData(TypedDict, total=False):
|
|
168
|
+
on_demand: Optional[OnDemandSubscriptionParam]
|
|
169
|
+
|
|
170
|
+
trial_period_days: Optional[int]
|
|
171
|
+
"""
|
|
172
|
+
Optional trial period in days If specified, this value overrides the trial
|
|
173
|
+
period set in the product's price Must be between 0 and 10000 days
|
|
174
|
+
"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["CheckoutSessionResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CheckoutSessionResponse(BaseModel):
|
|
9
|
+
checkout_url: str
|
|
10
|
+
"""Checkout url"""
|
|
11
|
+
|
|
12
|
+
session_id: str
|
|
13
|
+
"""The ID of the created checkout session"""
|
|
@@ -0,0 +1,44 @@
|
|
|
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 Optional
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from .currency import Currency
|
|
9
|
+
|
|
10
|
+
__all__ = ["OnDemandSubscriptionParam"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class OnDemandSubscriptionParam(TypedDict, total=False):
|
|
14
|
+
mandate_only: Required[bool]
|
|
15
|
+
"""
|
|
16
|
+
If set as True, does not perform any charge and only authorizes payment method
|
|
17
|
+
details for future use.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
adaptive_currency_fees_inclusive: Optional[bool]
|
|
21
|
+
"""
|
|
22
|
+
Whether adaptive currency fees should be included in the product_price (true) or
|
|
23
|
+
added on top (false). This field is ignored if adaptive pricing is not enabled
|
|
24
|
+
for the business.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
product_currency: Optional[Currency]
|
|
28
|
+
"""Optional currency of the product price.
|
|
29
|
+
|
|
30
|
+
If not specified, defaults to the currency of the product.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
product_description: Optional[str]
|
|
34
|
+
"""
|
|
35
|
+
Optional product description override for billing and line items. If not
|
|
36
|
+
specified, the stored description of the product will be used.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
product_price: Optional[int]
|
|
40
|
+
"""
|
|
41
|
+
Product price for the initial charge to customer If not specified the stored
|
|
42
|
+
price of the product will be used Represented in the lowest denomination of the
|
|
43
|
+
currency (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
|
44
|
+
"""
|
|
@@ -10,8 +10,9 @@ from .attach_addon_param import AttachAddonParam
|
|
|
10
10
|
from .payment_method_types import PaymentMethodTypes
|
|
11
11
|
from .billing_address_param import BillingAddressParam
|
|
12
12
|
from .customer_request_param import CustomerRequestParam
|
|
13
|
+
from .on_demand_subscription_param import OnDemandSubscriptionParam
|
|
13
14
|
|
|
14
|
-
__all__ = ["SubscriptionCreateParams"
|
|
15
|
+
__all__ = ["SubscriptionCreateParams"]
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class SubscriptionCreateParams(TypedDict, total=False):
|
|
@@ -51,7 +52,7 @@ class SubscriptionCreateParams(TypedDict, total=False):
|
|
|
51
52
|
metadata: Dict[str, str]
|
|
52
53
|
"""Additional metadata for the subscription Defaults to empty if not specified"""
|
|
53
54
|
|
|
54
|
-
on_demand: Optional[
|
|
55
|
+
on_demand: Optional[OnDemandSubscriptionParam]
|
|
55
56
|
|
|
56
57
|
payment_link: Optional[bool]
|
|
57
58
|
"""If true, generates a payment link. Defaults to false if not specified."""
|
|
@@ -73,37 +74,3 @@ class SubscriptionCreateParams(TypedDict, total=False):
|
|
|
73
74
|
Optional trial period in days If specified, this value overrides the trial
|
|
74
75
|
period set in the product's price Must be between 0 and 10000 days
|
|
75
76
|
"""
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class OnDemand(TypedDict, total=False):
|
|
79
|
-
mandate_only: Required[bool]
|
|
80
|
-
"""
|
|
81
|
-
If set as True, does not perform any charge and only authorizes payment method
|
|
82
|
-
details for future use.
|
|
83
|
-
"""
|
|
84
|
-
|
|
85
|
-
adaptive_currency_fees_inclusive: Optional[bool]
|
|
86
|
-
"""
|
|
87
|
-
Whether adaptive currency fees should be included in the product_price (true) or
|
|
88
|
-
added on top (false). This field is ignored if adaptive pricing is not enabled
|
|
89
|
-
for the business.
|
|
90
|
-
"""
|
|
91
|
-
|
|
92
|
-
product_currency: Optional[Currency]
|
|
93
|
-
"""Optional currency of the product price.
|
|
94
|
-
|
|
95
|
-
If not specified, defaults to the currency of the product.
|
|
96
|
-
"""
|
|
97
|
-
|
|
98
|
-
product_description: Optional[str]
|
|
99
|
-
"""
|
|
100
|
-
Optional product description override for billing and line items. If not
|
|
101
|
-
specified, the stored description of the product will be used.
|
|
102
|
-
"""
|
|
103
|
-
|
|
104
|
-
product_price: Optional[int]
|
|
105
|
-
"""
|
|
106
|
-
Product price for the initial charge to customer If not specified the stored
|
|
107
|
-
price of the product will be used Represented in the lowest denomination of the
|
|
108
|
-
currency (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
|
109
|
-
"""
|
|
@@ -17,6 +17,7 @@ class SubscriptionUpdateParams(TypedDict, total=False):
|
|
|
17
17
|
billing: Optional[BillingAddressParam]
|
|
18
18
|
|
|
19
19
|
cancel_at_next_billing_date: Optional[bool]
|
|
20
|
+
"""When set, the subscription will remain active until the end of billing period"""
|
|
20
21
|
|
|
21
22
|
disable_on_demand: Optional[DisableOnDemand]
|
|
22
23
|
|
|
@@ -4,10 +4,10 @@ from typing import Dict, List, Optional
|
|
|
4
4
|
|
|
5
5
|
from .._models import BaseModel
|
|
6
6
|
|
|
7
|
-
__all__ = ["
|
|
7
|
+
__all__ = ["WebhookDetails"]
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class WebhookDetails(BaseModel):
|
|
11
11
|
id: str
|
|
12
12
|
"""The webhook's ID."""
|
|
13
13
|
|