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.
@@ -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 Literal, Required, TypedDict
6
+ from typing_extensions import Required, TypedDict
7
7
 
8
- from .._types import SequenceNotStr
9
8
  from .currency import Currency
10
- from .country_code import CountryCode
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 .on_demand_subscription_param import OnDemandSubscriptionParam
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
- "CheckoutSessionPreviewParams",
18
- "ProductCart",
19
- "BillingAddress",
20
- "CustomField",
21
- "Customization",
22
- "CustomizationThemeConfig",
23
- "CustomizationThemeConfigDark",
24
- "CustomizationThemeConfigLight",
25
- "FeatureFlags",
26
- "SubscriptionData",
27
- ]
18
+ __all__ = ["CheckoutSessionPreviewParams"]
28
19
 
29
20
 
30
21
  class CheckoutSessionPreviewParams(TypedDict, total=False):
31
- product_cart: Required[Iterable[ProductCart]]
22
+ product_cart: Required[Iterable[ProductItemReqParam]]
32
23
 
33
24
  allowed_payment_method_types: Optional[List[PaymentMethodTypes]]
34
25
  """
@@ -40,7 +31,7 @@ class CheckoutSessionPreviewParams(TypedDict, total=False):
40
31
  methods are unavailable, checkout session will fail.
41
32
  """
42
33
 
43
- billing_address: Optional[BillingAddress]
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 CheckoutSessionPreviewParams(TypedDict, total=False):
52
43
  If required data is missing, an API error is thrown.
53
44
  """
54
45
 
55
- custom_fields: Optional[Iterable[CustomField]]
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: 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: FeatureFlags
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 CheckoutSessionPreviewParams(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[SubscriptionData]
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,32 @@
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, Required, TypedDict
7
+
8
+ from .._types import SequenceNotStr
9
+
10
+ __all__ = ["CustomFieldParam"]
11
+
12
+
13
+ class CustomFieldParam(TypedDict, total=False):
14
+ """Definition of a custom field for checkout"""
15
+
16
+ field_type: Required[Literal["text", "number", "email", "url", "date", "dropdown", "boolean"]]
17
+ """Type of field determining validation rules"""
18
+
19
+ key: Required[str]
20
+ """Unique identifier for this field (used as key in responses)"""
21
+
22
+ label: Required[str]
23
+ """Display label shown to customer"""
24
+
25
+ options: Optional[SequenceNotStr[str]]
26
+ """Options for dropdown type (required for dropdown, ignored for others)"""
27
+
28
+ placeholder: Optional[str]
29
+ """Placeholder text for the input"""
30
+
31
+ required: bool
32
+ """Whether this field is required"""
@@ -2,6 +2,7 @@
2
2
 
3
3
  from typing import Dict, List, Optional
4
4
  from datetime import datetime
5
+ from typing_extensions import Literal
5
6
 
6
7
  from .dispute import Dispute
7
8
  from .._models import BaseModel
@@ -165,6 +166,12 @@ class Payment(BaseModel):
165
166
  product_cart: Optional[List[ProductCart]] = None
166
167
  """List of products purchased in a one-time payment"""
167
168
 
169
+ refund_status: Optional[Literal["partial", "full"]] = None
170
+ """Summary of the refund status for this payment.
171
+
172
+ None if no succeeded refunds exist.
173
+ """
174
+
168
175
  settlement_tax: Optional[int] = None
169
176
  """
170
177
  This represents the portion of settlement_amount that corresponds to taxes
@@ -0,0 +1,31 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Iterable, Optional
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ from .attach_addon_param import AttachAddonParam
9
+
10
+ __all__ = ["ProductItemReqParam"]
11
+
12
+
13
+ class ProductItemReqParam(TypedDict, total=False):
14
+ product_id: Required[str]
15
+ """unique id of the product"""
16
+
17
+ quantity: Required[int]
18
+
19
+ addons: Optional[Iterable[AttachAddonParam]]
20
+ """only valid if product is a subscription"""
21
+
22
+ amount: Optional[int]
23
+ """Amount the customer pays if pay_what_you_want is enabled.
24
+
25
+ If disabled then amount will be ignored Represented in the lowest denomination
26
+ of the currency (e.g., cents for USD). For example, to charge $1.00, pass `100`.
27
+ Only applicable for one time payments
28
+
29
+ If amount is not set for pay_what_you_want product, customer is allowed to
30
+ select the amount.
31
+ """
@@ -31,3 +31,13 @@ class SubscriptionChangePlanParams(TypedDict, total=False):
31
31
 
32
32
  If not passed, the metadata of the subscription will be taken
33
33
  """
34
+
35
+ on_payment_failure: Optional[Literal["prevent_change", "apply_change"]]
36
+ """Controls behavior when the plan change payment fails.
37
+
38
+ - `prevent_change`: Keep subscription on current plan until payment succeeds
39
+ - `apply_change` (default): Apply plan change immediately regardless of payment
40
+ outcome
41
+
42
+ If not specified, uses the business-level default setting.
43
+ """
@@ -0,0 +1,20 @@
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 TypedDict
7
+
8
+ from .on_demand_subscription_param import OnDemandSubscriptionParam
9
+
10
+ __all__ = ["SubscriptionDataParam"]
11
+
12
+
13
+ class SubscriptionDataParam(TypedDict, total=False):
14
+ on_demand: Optional[OnDemandSubscriptionParam]
15
+
16
+ trial_period_days: Optional[int]
17
+ """
18
+ Optional trial period in days If specified, this value overrides the trial
19
+ period set in the product's price Must be between 0 and 10000 days
20
+ """
@@ -31,3 +31,13 @@ class SubscriptionPreviewChangePlanParams(TypedDict, total=False):
31
31
 
32
32
  If not passed, the metadata of the subscription will be taken
33
33
  """
34
+
35
+ on_payment_failure: Optional[Literal["prevent_change", "apply_change"]]
36
+ """Controls behavior when the plan change payment fails.
37
+
38
+ - `prevent_change`: Keep subscription on current plan until payment succeeds
39
+ - `apply_change` (default): Apply plan change immediately regardless of payment
40
+ outcome
41
+
42
+ If not specified, uses the business-level default setting.
43
+ """
@@ -0,0 +1,38 @@
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_mode_config_param import ThemeModeConfigParam
9
+
10
+ __all__ = ["ThemeConfigParam"]
11
+
12
+
13
+ class ThemeConfigParam(TypedDict, total=False):
14
+ """Custom theme configuration with colors for light and dark modes."""
15
+
16
+ dark: Optional[ThemeModeConfigParam]
17
+ """Dark mode color configuration"""
18
+
19
+ font_primary_url: Optional[str]
20
+ """URL for the primary font"""
21
+
22
+ font_secondary_url: Optional[str]
23
+ """URL for the secondary font"""
24
+
25
+ font_size: Optional[Literal["xs", "sm", "md", "lg", "xl", "2xl"]]
26
+ """Font size for the checkout UI"""
27
+
28
+ font_weight: Optional[Literal["normal", "medium", "bold", "extraBold"]]
29
+ """Font weight for the checkout UI"""
30
+
31
+ light: Optional[ThemeModeConfigParam]
32
+ """Light mode color configuration"""
33
+
34
+ pay_button_text: Optional[str]
35
+ """Custom text for the pay button (e.g., "Complete Purchase", "Subscribe Now")"""
36
+
37
+ radius: Optional[str]
38
+ """Border radius for UI elements (e.g., "4px", "0.5rem", "8px")"""
@@ -0,0 +1,71 @@
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 TypedDict
7
+
8
+ __all__ = ["ThemeModeConfigParam"]
9
+
10
+
11
+ class ThemeModeConfigParam(TypedDict, total=False):
12
+ """Color configuration for a single theme mode (light or dark).
13
+
14
+ All color fields accept standard CSS color formats:
15
+ - Hex: `#fff`, `#ffffff`, `#ffffffff` (with or without # prefix)
16
+ - RGB/RGBA: `rgb(255, 255, 255)`, `rgba(255, 255, 255, 0.5)`
17
+ - HSL/HSLA: `hsl(120, 100%, 50%)`, `hsla(120, 100%, 50%, 0.5)`
18
+ - Named colors: `red`, `blue`, `transparent`, etc.
19
+ - Advanced: `hwb()`, `lab()`, `lch()`, `oklab()`, `oklch()`, `color()`
20
+ """
21
+
22
+ bg_primary: Optional[str]
23
+ """Background primary color
24
+
25
+ Examples: `"#ffffff"`, `"rgb(255, 255, 255)"`, `"white"`
26
+ """
27
+
28
+ bg_secondary: Optional[str]
29
+ """Background secondary color"""
30
+
31
+ border_primary: Optional[str]
32
+ """Border primary color"""
33
+
34
+ border_secondary: Optional[str]
35
+ """Border secondary color"""
36
+
37
+ button_primary: Optional[str]
38
+ """Primary button background color"""
39
+
40
+ button_primary_hover: Optional[str]
41
+ """Primary button hover color"""
42
+
43
+ button_secondary: Optional[str]
44
+ """Secondary button background color"""
45
+
46
+ button_secondary_hover: Optional[str]
47
+ """Secondary button hover color"""
48
+
49
+ button_text_primary: Optional[str]
50
+ """Primary button text color"""
51
+
52
+ button_text_secondary: Optional[str]
53
+ """Secondary button text color"""
54
+
55
+ input_focus_border: Optional[str]
56
+ """Input focus border color"""
57
+
58
+ text_error: Optional[str]
59
+ """Text error color"""
60
+
61
+ text_placeholder: Optional[str]
62
+ """Text placeholder color"""
63
+
64
+ text_primary: Optional[str]
65
+ """Text primary color"""
66
+
67
+ text_secondary: Optional[str]
68
+ """Text secondary color"""
69
+
70
+ text_success: Optional[str]
71
+ """Text success color"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dodopayments
3
- Version: 1.78.0
3
+ Version: 1.81.0
4
4
  Summary: The official Python library for the Dodo Payments API
5
5
  Project-URL: Homepage, https://github.com/dodopayments/dodopayments-python
6
6
  Project-URL: Repository, https://github.com/dodopayments/dodopayments-python