dodopayments 1.78.0__py3-none-any.whl → 1.81.0__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 +38 -0
- dodopayments/_version.py +1 -1
- dodopayments/resources/__init__.py +14 -0
- dodopayments/resources/balances.py +576 -0
- dodopayments/resources/checkout_sessions.py +35 -25
- dodopayments/resources/subscriptions.py +40 -0
- dodopayments/types/__init__.py +12 -0
- dodopayments/types/balance_ledger_entry.py +55 -0
- dodopayments/types/balance_retrieve_ledger_params.py +204 -0
- dodopayments/types/checkout_session_billing_address_param.py +27 -0
- dodopayments/types/checkout_session_create_params.py +14 -309
- dodopayments/types/checkout_session_customization_param.py +36 -0
- dodopayments/types/checkout_session_flags_param.py +61 -0
- dodopayments/types/checkout_session_preview_params.py +14 -309
- dodopayments/types/custom_field_param.py +32 -0
- dodopayments/types/payment.py +7 -0
- dodopayments/types/product_item_req_param.py +31 -0
- dodopayments/types/subscription_change_plan_params.py +10 -0
- dodopayments/types/subscription_data_param.py +20 -0
- dodopayments/types/subscription_preview_change_plan_params.py +10 -0
- dodopayments/types/theme_config_param.py +38 -0
- dodopayments/types/theme_mode_config_param.py +71 -0
- {dodopayments-1.78.0.dist-info → dodopayments-1.81.0.dist-info}/METADATA +1 -1
- {dodopayments-1.78.0.dist-info → dodopayments-1.81.0.dist-info}/RECORD +26 -15
- {dodopayments-1.78.0.dist-info → dodopayments-1.81.0.dist-info}/WHEEL +0 -0
- {dodopayments-1.78.0.dist-info → dodopayments-1.81.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -3,32 +3,23 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from typing import Dict, List, Iterable, Optional
|
|
6
|
-
from typing_extensions import
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
7
|
|
|
8
|
-
from .._types import SequenceNotStr
|
|
9
8
|
from .currency import Currency
|
|
10
|
-
from .
|
|
11
|
-
from .attach_addon_param import AttachAddonParam
|
|
9
|
+
from .custom_field_param import CustomFieldParam
|
|
12
10
|
from .payment_method_types import PaymentMethodTypes
|
|
13
11
|
from .customer_request_param import CustomerRequestParam
|
|
14
|
-
from .
|
|
12
|
+
from .product_item_req_param import ProductItemReqParam
|
|
13
|
+
from .subscription_data_param import SubscriptionDataParam
|
|
14
|
+
from .checkout_session_flags_param import CheckoutSessionFlagsParam
|
|
15
|
+
from .checkout_session_customization_param import CheckoutSessionCustomizationParam
|
|
16
|
+
from .checkout_session_billing_address_param import CheckoutSessionBillingAddressParam
|
|
15
17
|
|
|
16
|
-
__all__ = [
|
|
17
|
-
"CheckoutSessionCreateParams",
|
|
18
|
-
"ProductCart",
|
|
19
|
-
"BillingAddress",
|
|
20
|
-
"CustomField",
|
|
21
|
-
"Customization",
|
|
22
|
-
"CustomizationThemeConfig",
|
|
23
|
-
"CustomizationThemeConfigDark",
|
|
24
|
-
"CustomizationThemeConfigLight",
|
|
25
|
-
"FeatureFlags",
|
|
26
|
-
"SubscriptionData",
|
|
27
|
-
]
|
|
18
|
+
__all__ = ["CheckoutSessionCreateParams"]
|
|
28
19
|
|
|
29
20
|
|
|
30
21
|
class CheckoutSessionCreateParams(TypedDict, total=False):
|
|
31
|
-
product_cart: Required[Iterable[
|
|
22
|
+
product_cart: Required[Iterable[ProductItemReqParam]]
|
|
32
23
|
|
|
33
24
|
allowed_payment_method_types: Optional[List[PaymentMethodTypes]]
|
|
34
25
|
"""
|
|
@@ -40,7 +31,7 @@ class CheckoutSessionCreateParams(TypedDict, total=False):
|
|
|
40
31
|
methods are unavailable, checkout session will fail.
|
|
41
32
|
"""
|
|
42
33
|
|
|
43
|
-
billing_address: Optional[
|
|
34
|
+
billing_address: Optional[CheckoutSessionBillingAddressParam]
|
|
44
35
|
"""Billing address information for the session"""
|
|
45
36
|
|
|
46
37
|
billing_currency: Optional[Currency]
|
|
@@ -52,18 +43,18 @@ class CheckoutSessionCreateParams(TypedDict, total=False):
|
|
|
52
43
|
If required data is missing, an API error is thrown.
|
|
53
44
|
"""
|
|
54
45
|
|
|
55
|
-
custom_fields: Optional[Iterable[
|
|
46
|
+
custom_fields: Optional[Iterable[CustomFieldParam]]
|
|
56
47
|
"""Custom fields to collect from customer during checkout (max 5 fields)"""
|
|
57
48
|
|
|
58
49
|
customer: Optional[CustomerRequestParam]
|
|
59
50
|
"""Customer details for the session"""
|
|
60
51
|
|
|
61
|
-
customization:
|
|
52
|
+
customization: CheckoutSessionCustomizationParam
|
|
62
53
|
"""Customization for the checkout session page"""
|
|
63
54
|
|
|
64
55
|
discount_code: Optional[str]
|
|
65
56
|
|
|
66
|
-
feature_flags:
|
|
57
|
+
feature_flags: CheckoutSessionFlagsParam
|
|
67
58
|
|
|
68
59
|
force_3ds: Optional[bool]
|
|
69
60
|
"""Override merchant default 3DS behaviour for this session"""
|
|
@@ -98,290 +89,4 @@ class CheckoutSessionCreateParams(TypedDict, total=False):
|
|
|
98
89
|
show_saved_payment_methods: bool
|
|
99
90
|
"""Display saved payment methods of a returning customer False by default"""
|
|
100
91
|
|
|
101
|
-
subscription_data: Optional[
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class ProductCart(TypedDict, total=False):
|
|
105
|
-
product_id: Required[str]
|
|
106
|
-
"""unique id of the product"""
|
|
107
|
-
|
|
108
|
-
quantity: Required[int]
|
|
109
|
-
|
|
110
|
-
addons: Optional[Iterable[AttachAddonParam]]
|
|
111
|
-
"""only valid if product is a subscription"""
|
|
112
|
-
|
|
113
|
-
amount: Optional[int]
|
|
114
|
-
"""Amount the customer pays if pay_what_you_want is enabled.
|
|
115
|
-
|
|
116
|
-
If disabled then amount will be ignored Represented in the lowest denomination
|
|
117
|
-
of the currency (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
|
118
|
-
Only applicable for one time payments
|
|
119
|
-
|
|
120
|
-
If amount is not set for pay_what_you_want product, customer is allowed to
|
|
121
|
-
select the amount.
|
|
122
|
-
"""
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
class BillingAddress(TypedDict, total=False):
|
|
126
|
-
"""Billing address information for the session"""
|
|
127
|
-
|
|
128
|
-
country: Required[CountryCode]
|
|
129
|
-
"""Two-letter ISO country code (ISO 3166-1 alpha-2)"""
|
|
130
|
-
|
|
131
|
-
city: Optional[str]
|
|
132
|
-
"""City name"""
|
|
133
|
-
|
|
134
|
-
state: Optional[str]
|
|
135
|
-
"""State or province name"""
|
|
136
|
-
|
|
137
|
-
street: Optional[str]
|
|
138
|
-
"""Street address including house number and unit/apartment if applicable"""
|
|
139
|
-
|
|
140
|
-
zipcode: Optional[str]
|
|
141
|
-
"""Postal code or ZIP code"""
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
class CustomField(TypedDict, total=False):
|
|
145
|
-
"""Definition of a custom field for checkout"""
|
|
146
|
-
|
|
147
|
-
field_type: Required[Literal["text", "number", "email", "url", "date", "dropdown", "boolean"]]
|
|
148
|
-
"""Type of field determining validation rules"""
|
|
149
|
-
|
|
150
|
-
key: Required[str]
|
|
151
|
-
"""Unique identifier for this field (used as key in responses)"""
|
|
152
|
-
|
|
153
|
-
label: Required[str]
|
|
154
|
-
"""Display label shown to customer"""
|
|
155
|
-
|
|
156
|
-
options: Optional[SequenceNotStr[str]]
|
|
157
|
-
"""Options for dropdown type (required for dropdown, ignored for others)"""
|
|
158
|
-
|
|
159
|
-
placeholder: Optional[str]
|
|
160
|
-
"""Placeholder text for the input"""
|
|
161
|
-
|
|
162
|
-
required: bool
|
|
163
|
-
"""Whether this field is required"""
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
class CustomizationThemeConfigDark(TypedDict, total=False):
|
|
167
|
-
"""Dark mode color configuration"""
|
|
168
|
-
|
|
169
|
-
bg_primary: Optional[str]
|
|
170
|
-
"""Background primary color
|
|
171
|
-
|
|
172
|
-
Examples: `"#ffffff"`, `"rgb(255, 255, 255)"`, `"white"`
|
|
173
|
-
"""
|
|
174
|
-
|
|
175
|
-
bg_secondary: Optional[str]
|
|
176
|
-
"""Background secondary color"""
|
|
177
|
-
|
|
178
|
-
border_primary: Optional[str]
|
|
179
|
-
"""Border primary color"""
|
|
180
|
-
|
|
181
|
-
border_secondary: Optional[str]
|
|
182
|
-
"""Border secondary color"""
|
|
183
|
-
|
|
184
|
-
button_primary: Optional[str]
|
|
185
|
-
"""Primary button background color"""
|
|
186
|
-
|
|
187
|
-
button_primary_hover: Optional[str]
|
|
188
|
-
"""Primary button hover color"""
|
|
189
|
-
|
|
190
|
-
button_secondary: Optional[str]
|
|
191
|
-
"""Secondary button background color"""
|
|
192
|
-
|
|
193
|
-
button_secondary_hover: Optional[str]
|
|
194
|
-
"""Secondary button hover color"""
|
|
195
|
-
|
|
196
|
-
button_text_primary: Optional[str]
|
|
197
|
-
"""Primary button text color"""
|
|
198
|
-
|
|
199
|
-
button_text_secondary: Optional[str]
|
|
200
|
-
"""Secondary button text color"""
|
|
201
|
-
|
|
202
|
-
input_focus_border: Optional[str]
|
|
203
|
-
"""Input focus border color"""
|
|
204
|
-
|
|
205
|
-
text_error: Optional[str]
|
|
206
|
-
"""Text error color"""
|
|
207
|
-
|
|
208
|
-
text_placeholder: Optional[str]
|
|
209
|
-
"""Text placeholder color"""
|
|
210
|
-
|
|
211
|
-
text_primary: Optional[str]
|
|
212
|
-
"""Text primary color"""
|
|
213
|
-
|
|
214
|
-
text_secondary: Optional[str]
|
|
215
|
-
"""Text secondary color"""
|
|
216
|
-
|
|
217
|
-
text_success: Optional[str]
|
|
218
|
-
"""Text success color"""
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
class CustomizationThemeConfigLight(TypedDict, total=False):
|
|
222
|
-
"""Light mode color configuration"""
|
|
223
|
-
|
|
224
|
-
bg_primary: Optional[str]
|
|
225
|
-
"""Background primary color
|
|
226
|
-
|
|
227
|
-
Examples: `"#ffffff"`, `"rgb(255, 255, 255)"`, `"white"`
|
|
228
|
-
"""
|
|
229
|
-
|
|
230
|
-
bg_secondary: Optional[str]
|
|
231
|
-
"""Background secondary color"""
|
|
232
|
-
|
|
233
|
-
border_primary: Optional[str]
|
|
234
|
-
"""Border primary color"""
|
|
235
|
-
|
|
236
|
-
border_secondary: Optional[str]
|
|
237
|
-
"""Border secondary color"""
|
|
238
|
-
|
|
239
|
-
button_primary: Optional[str]
|
|
240
|
-
"""Primary button background color"""
|
|
241
|
-
|
|
242
|
-
button_primary_hover: Optional[str]
|
|
243
|
-
"""Primary button hover color"""
|
|
244
|
-
|
|
245
|
-
button_secondary: Optional[str]
|
|
246
|
-
"""Secondary button background color"""
|
|
247
|
-
|
|
248
|
-
button_secondary_hover: Optional[str]
|
|
249
|
-
"""Secondary button hover color"""
|
|
250
|
-
|
|
251
|
-
button_text_primary: Optional[str]
|
|
252
|
-
"""Primary button text color"""
|
|
253
|
-
|
|
254
|
-
button_text_secondary: Optional[str]
|
|
255
|
-
"""Secondary button text color"""
|
|
256
|
-
|
|
257
|
-
input_focus_border: Optional[str]
|
|
258
|
-
"""Input focus border color"""
|
|
259
|
-
|
|
260
|
-
text_error: Optional[str]
|
|
261
|
-
"""Text error color"""
|
|
262
|
-
|
|
263
|
-
text_placeholder: Optional[str]
|
|
264
|
-
"""Text placeholder color"""
|
|
265
|
-
|
|
266
|
-
text_primary: Optional[str]
|
|
267
|
-
"""Text primary color"""
|
|
268
|
-
|
|
269
|
-
text_secondary: Optional[str]
|
|
270
|
-
"""Text secondary color"""
|
|
271
|
-
|
|
272
|
-
text_success: Optional[str]
|
|
273
|
-
"""Text success color"""
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
class CustomizationThemeConfig(TypedDict, total=False):
|
|
277
|
-
"""Optional custom theme configuration with colors for light and dark modes"""
|
|
278
|
-
|
|
279
|
-
dark: Optional[CustomizationThemeConfigDark]
|
|
280
|
-
"""Dark mode color configuration"""
|
|
281
|
-
|
|
282
|
-
font_size: Optional[Literal["xs", "sm", "md", "lg", "xl", "2xl"]]
|
|
283
|
-
"""Font size for the checkout UI"""
|
|
284
|
-
|
|
285
|
-
font_weight: Optional[Literal["normal", "medium", "bold", "extraBold"]]
|
|
286
|
-
"""Font weight for the checkout UI"""
|
|
287
|
-
|
|
288
|
-
light: Optional[CustomizationThemeConfigLight]
|
|
289
|
-
"""Light mode color configuration"""
|
|
290
|
-
|
|
291
|
-
pay_button_text: Optional[str]
|
|
292
|
-
"""Custom text for the pay button (e.g., "Complete Purchase", "Subscribe Now")"""
|
|
293
|
-
|
|
294
|
-
radius: Optional[str]
|
|
295
|
-
"""Border radius for UI elements (e.g., "4px", "0.5rem", "8px")"""
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
class Customization(TypedDict, total=False):
|
|
299
|
-
"""Customization for the checkout session page"""
|
|
300
|
-
|
|
301
|
-
force_language: Optional[str]
|
|
302
|
-
"""Force the checkout interface to render in a specific language (e.g. `en`, `es`)"""
|
|
303
|
-
|
|
304
|
-
show_on_demand_tag: bool
|
|
305
|
-
"""Show on demand tag
|
|
306
|
-
|
|
307
|
-
Default is true
|
|
308
|
-
"""
|
|
309
|
-
|
|
310
|
-
show_order_details: bool
|
|
311
|
-
"""Show order details by default
|
|
312
|
-
|
|
313
|
-
Default is true
|
|
314
|
-
"""
|
|
315
|
-
|
|
316
|
-
theme: Literal["dark", "light", "system"]
|
|
317
|
-
"""Theme of the page (determines which mode - light/dark/system - to use)
|
|
318
|
-
|
|
319
|
-
Default is `System`.
|
|
320
|
-
"""
|
|
321
|
-
|
|
322
|
-
theme_config: Optional[CustomizationThemeConfig]
|
|
323
|
-
"""Optional custom theme configuration with colors for light and dark modes"""
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
class FeatureFlags(TypedDict, total=False):
|
|
327
|
-
allow_currency_selection: bool
|
|
328
|
-
"""if customer is allowed to change currency, set it to true
|
|
329
|
-
|
|
330
|
-
Default is true
|
|
331
|
-
"""
|
|
332
|
-
|
|
333
|
-
allow_customer_editing_city: bool
|
|
334
|
-
|
|
335
|
-
allow_customer_editing_country: bool
|
|
336
|
-
|
|
337
|
-
allow_customer_editing_email: bool
|
|
338
|
-
|
|
339
|
-
allow_customer_editing_name: bool
|
|
340
|
-
|
|
341
|
-
allow_customer_editing_state: bool
|
|
342
|
-
|
|
343
|
-
allow_customer_editing_street: bool
|
|
344
|
-
|
|
345
|
-
allow_customer_editing_zipcode: bool
|
|
346
|
-
|
|
347
|
-
allow_discount_code: bool
|
|
348
|
-
"""If the customer is allowed to apply discount code, set it to true.
|
|
349
|
-
|
|
350
|
-
Default is true
|
|
351
|
-
"""
|
|
352
|
-
|
|
353
|
-
allow_phone_number_collection: bool
|
|
354
|
-
"""If phone number is collected from customer, set it to rue
|
|
355
|
-
|
|
356
|
-
Default is true
|
|
357
|
-
"""
|
|
358
|
-
|
|
359
|
-
allow_tax_id: bool
|
|
360
|
-
"""If the customer is allowed to add tax id, set it to true
|
|
361
|
-
|
|
362
|
-
Default is true
|
|
363
|
-
"""
|
|
364
|
-
|
|
365
|
-
always_create_new_customer: bool
|
|
366
|
-
"""
|
|
367
|
-
Set to true if a new customer object should be created. By default email is used
|
|
368
|
-
to find an existing customer to attach the session to
|
|
369
|
-
|
|
370
|
-
Default is false
|
|
371
|
-
"""
|
|
372
|
-
|
|
373
|
-
redirect_immediately: bool
|
|
374
|
-
"""If true, redirects the customer immediately after payment completion
|
|
375
|
-
|
|
376
|
-
Default is false
|
|
377
|
-
"""
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
class SubscriptionData(TypedDict, total=False):
|
|
381
|
-
on_demand: Optional[OnDemandSubscriptionParam]
|
|
382
|
-
|
|
383
|
-
trial_period_days: Optional[int]
|
|
384
|
-
"""
|
|
385
|
-
Optional trial period in days If specified, this value overrides the trial
|
|
386
|
-
period set in the product's price Must be between 0 and 10000 days
|
|
387
|
-
"""
|
|
92
|
+
subscription_data: Optional[SubscriptionDataParam]
|
|
@@ -0,0 +1,36 @@
|
|
|
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 Literal, TypedDict
|
|
7
|
+
|
|
8
|
+
from .theme_config_param import ThemeConfigParam
|
|
9
|
+
|
|
10
|
+
__all__ = ["CheckoutSessionCustomizationParam"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CheckoutSessionCustomizationParam(TypedDict, total=False):
|
|
14
|
+
force_language: Optional[str]
|
|
15
|
+
"""Force the checkout interface to render in a specific language (e.g. `en`, `es`)"""
|
|
16
|
+
|
|
17
|
+
show_on_demand_tag: bool
|
|
18
|
+
"""Show on demand tag
|
|
19
|
+
|
|
20
|
+
Default is true
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
show_order_details: bool
|
|
24
|
+
"""Show order details by default
|
|
25
|
+
|
|
26
|
+
Default is true
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
theme: Literal["dark", "light", "system"]
|
|
30
|
+
"""Theme of the page (determines which mode - light/dark/system - to use)
|
|
31
|
+
|
|
32
|
+
Default is `System`.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
theme_config: Optional[ThemeConfigParam]
|
|
36
|
+
"""Optional custom theme configuration with colors for light and dark modes"""
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["CheckoutSessionFlagsParam"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CheckoutSessionFlagsParam(TypedDict, total=False):
|
|
11
|
+
allow_currency_selection: bool
|
|
12
|
+
"""if customer is allowed to change currency, set it to true
|
|
13
|
+
|
|
14
|
+
Default is true
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
allow_customer_editing_city: bool
|
|
18
|
+
|
|
19
|
+
allow_customer_editing_country: bool
|
|
20
|
+
|
|
21
|
+
allow_customer_editing_email: bool
|
|
22
|
+
|
|
23
|
+
allow_customer_editing_name: bool
|
|
24
|
+
|
|
25
|
+
allow_customer_editing_state: bool
|
|
26
|
+
|
|
27
|
+
allow_customer_editing_street: bool
|
|
28
|
+
|
|
29
|
+
allow_customer_editing_zipcode: bool
|
|
30
|
+
|
|
31
|
+
allow_discount_code: bool
|
|
32
|
+
"""If the customer is allowed to apply discount code, set it to true.
|
|
33
|
+
|
|
34
|
+
Default is true
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
allow_phone_number_collection: bool
|
|
38
|
+
"""If phone number is collected from customer, set it to rue
|
|
39
|
+
|
|
40
|
+
Default is true
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
allow_tax_id: bool
|
|
44
|
+
"""If the customer is allowed to add tax id, set it to true
|
|
45
|
+
|
|
46
|
+
Default is true
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
always_create_new_customer: bool
|
|
50
|
+
"""
|
|
51
|
+
Set to true if a new customer object should be created. By default email is used
|
|
52
|
+
to find an existing customer to attach the session to
|
|
53
|
+
|
|
54
|
+
Default is false
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
redirect_immediately: bool
|
|
58
|
+
"""If true, redirects the customer immediately after payment completion
|
|
59
|
+
|
|
60
|
+
Default is false
|
|
61
|
+
"""
|