dodopayments 1.51.1__py3-none-any.whl → 1.56.5__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/__init__.py +5 -1
- dodopayments/_base_client.py +12 -12
- dodopayments/_client.py +52 -14
- dodopayments/_compat.py +48 -48
- dodopayments/_exceptions.py +4 -0
- dodopayments/_models.py +50 -44
- dodopayments/_qs.py +7 -7
- dodopayments/_streaming.py +4 -6
- dodopayments/_types.py +18 -11
- dodopayments/_utils/__init__.py +8 -2
- dodopayments/_utils/_compat.py +45 -0
- dodopayments/_utils/_datetime_parse.py +136 -0
- dodopayments/_utils/_transform.py +13 -3
- dodopayments/_utils/_typing.py +1 -1
- dodopayments/_utils/_utils.py +5 -6
- dodopayments/_version.py +1 -1
- dodopayments/resources/__init__.py +28 -0
- dodopayments/resources/addons.py +29 -29
- dodopayments/resources/brands.py +29 -29
- dodopayments/resources/checkout_sessions.py +110 -27
- dodopayments/resources/customers/__init__.py +14 -0
- dodopayments/resources/customers/customer_portal.py +5 -5
- dodopayments/resources/customers/customers.py +53 -21
- dodopayments/resources/customers/wallets/__init__.py +33 -0
- dodopayments/resources/customers/wallets/ledger_entries.py +318 -0
- dodopayments/resources/customers/wallets/wallets.py +191 -0
- dodopayments/resources/discounts.py +44 -44
- dodopayments/resources/disputes.py +19 -19
- dodopayments/resources/invoices/payments.py +83 -3
- dodopayments/resources/license_key_instances.py +13 -13
- dodopayments/resources/license_keys.py +23 -23
- dodopayments/resources/licenses.py +14 -14
- dodopayments/resources/meters.py +554 -0
- dodopayments/resources/misc.py +3 -3
- dodopayments/resources/payments.py +49 -41
- dodopayments/resources/payouts.py +26 -7
- dodopayments/resources/products/images.py +5 -5
- dodopayments/resources/products/products.py +82 -82
- dodopayments/resources/refunds.py +39 -30
- dodopayments/resources/subscriptions.py +316 -73
- dodopayments/resources/usage_events.py +597 -0
- dodopayments/resources/webhooks/headers.py +5 -5
- dodopayments/resources/webhooks/webhooks.py +119 -44
- dodopayments/types/__init__.py +48 -0
- dodopayments/types/add_meter_to_price.py +29 -0
- dodopayments/types/add_meter_to_price_param.py +30 -0
- dodopayments/types/checkout_session_create_params.py +6 -0
- dodopayments/types/checkout_session_status.py +35 -0
- dodopayments/types/customer_limited_details.py +5 -0
- dodopayments/types/customers/__init__.py +2 -0
- dodopayments/types/customers/customer_wallet.py +20 -0
- dodopayments/types/customers/wallet_list_response.py +15 -0
- dodopayments/types/customers/wallets/__init__.py +7 -0
- dodopayments/types/customers/wallets/customer_wallet_transaction.py +38 -0
- dodopayments/types/customers/wallets/ledger_entry_create_params.py +25 -0
- dodopayments/types/customers/wallets/ledger_entry_list_params.py +18 -0
- dodopayments/types/discount_create_params.py +3 -2
- dodopayments/types/discount_update_params.py +3 -2
- dodopayments/types/dispute_accepted_webhook_event.py +29 -0
- dodopayments/types/dispute_accepted_webhook_event1.py +29 -0
- dodopayments/types/dispute_cancelled_webhook_event.py +29 -0
- dodopayments/types/dispute_cancelled_webhook_event1.py +29 -0
- dodopayments/types/dispute_challenged_webhook_event.py +29 -0
- dodopayments/types/dispute_challenged_webhook_event1.py +29 -0
- dodopayments/types/dispute_expired_webhook_event.py +29 -0
- dodopayments/types/dispute_expired_webhook_event1.py +29 -0
- dodopayments/types/dispute_lost_webhook_event.py +29 -0
- dodopayments/types/dispute_lost_webhook_event1.py +29 -0
- dodopayments/types/dispute_opened_webhook_event.py +29 -0
- dodopayments/types/dispute_opened_webhook_event1.py +29 -0
- dodopayments/types/dispute_won_webhook_event.py +29 -0
- dodopayments/types/dispute_won_webhook_event1.py +29 -0
- dodopayments/types/event.py +26 -0
- dodopayments/types/event_input_param.py +38 -0
- dodopayments/types/license_activate_response.py +40 -0
- dodopayments/types/license_key_created_webhook_event.py +29 -0
- dodopayments/types/license_key_created_webhook_event1.py +29 -0
- dodopayments/types/meter.py +40 -0
- dodopayments/types/meter_aggregation.py +16 -0
- dodopayments/types/meter_aggregation_param.py +16 -0
- dodopayments/types/meter_create_params.py +31 -0
- dodopayments/types/meter_filter.py +131 -0
- dodopayments/types/meter_filter_param.py +143 -0
- dodopayments/types/meter_list_params.py +18 -0
- dodopayments/types/new_customer_param.py +7 -1
- dodopayments/types/payment.py +37 -2
- dodopayments/types/payment_cancelled_webhook_event.py +29 -0
- dodopayments/types/payment_cancelled_webhook_event1.py +29 -0
- dodopayments/types/payment_create_params.py +3 -0
- dodopayments/types/payment_failed_webhook_event.py +29 -0
- dodopayments/types/payment_failed_webhook_event1.py +29 -0
- dodopayments/types/payment_method_types.py +1 -0
- dodopayments/types/payment_processing_webhook_event.py +29 -0
- dodopayments/types/payment_processing_webhook_event1.py +29 -0
- dodopayments/types/payment_succeeded_webhook_event.py +29 -0
- dodopayments/types/payment_succeeded_webhook_event1.py +29 -0
- dodopayments/types/payout_list_params.py +11 -1
- dodopayments/types/price.py +52 -5
- dodopayments/types/price_param.py +52 -5
- dodopayments/types/product_create_params.py +3 -2
- dodopayments/types/product_update_params.py +4 -3
- dodopayments/types/refund.py +8 -1
- dodopayments/types/refund_create_params.py +4 -1
- dodopayments/types/refund_failed_webhook_event.py +29 -0
- dodopayments/types/refund_failed_webhook_event1.py +29 -0
- dodopayments/types/refund_list_response.py +39 -0
- dodopayments/types/refund_succeeded_webhook_event.py +29 -0
- dodopayments/types/refund_succeeded_webhook_event1.py +29 -0
- dodopayments/types/subscription.py +23 -1
- dodopayments/types/subscription_active_webhook_event.py +29 -0
- dodopayments/types/subscription_active_webhook_event1.py +29 -0
- dodopayments/types/subscription_cancelled_webhook_event.py +29 -0
- dodopayments/types/subscription_cancelled_webhook_event1.py +29 -0
- dodopayments/types/subscription_charge_params.py +12 -1
- dodopayments/types/subscription_create_params.py +3 -0
- dodopayments/types/subscription_expired_webhook_event.py +29 -0
- dodopayments/types/subscription_expired_webhook_event1.py +29 -0
- dodopayments/types/subscription_failed_webhook_event.py +29 -0
- dodopayments/types/subscription_failed_webhook_event1.py +29 -0
- dodopayments/types/subscription_list_response.py +3 -0
- dodopayments/types/subscription_on_hold_webhook_event.py +29 -0
- dodopayments/types/subscription_on_hold_webhook_event1.py +29 -0
- dodopayments/types/subscription_plan_changed_webhook_event.py +29 -0
- dodopayments/types/subscription_plan_changed_webhook_event1.py +29 -0
- dodopayments/types/subscription_renewed_webhook_event.py +29 -0
- dodopayments/types/subscription_renewed_webhook_event1.py +29 -0
- dodopayments/types/subscription_retrieve_usage_history_params.py +28 -0
- dodopayments/types/subscription_retrieve_usage_history_response.py +46 -0
- dodopayments/types/subscription_update_params.py +2 -0
- dodopayments/types/unsafe_unwrap_webhook_event.py +52 -0
- dodopayments/types/unwrap_webhook_event.py +52 -0
- dodopayments/types/usage_event_ingest_params.py +15 -0
- dodopayments/types/usage_event_ingest_response.py +9 -0
- dodopayments/types/usage_event_list_params.py +42 -0
- {dodopayments-1.51.1.dist-info → dodopayments-1.56.5.dist-info}/METADATA +6 -4
- dodopayments-1.56.5.dist-info/RECORD +239 -0
- dodopayments-1.51.1.dist-info/RECORD +0 -163
- {dodopayments-1.51.1.dist-info → dodopayments-1.56.5.dist-info}/WHEEL +0 -0
- {dodopayments-1.51.1.dist-info → dodopayments-1.56.5.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import json
|
|
6
|
+
from typing import Dict, List, Mapping, Optional, cast
|
|
6
7
|
|
|
7
8
|
import httpx
|
|
8
9
|
|
|
@@ -15,9 +16,10 @@ from .headers import (
|
|
|
15
16
|
HeadersResourceWithStreamingResponse,
|
|
16
17
|
AsyncHeadersResourceWithStreamingResponse,
|
|
17
18
|
)
|
|
18
|
-
from ..._types import
|
|
19
|
+
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
|
|
19
20
|
from ..._utils import maybe_transform, async_maybe_transform
|
|
20
21
|
from ..._compat import cached_property
|
|
22
|
+
from ..._models import construct_type
|
|
21
23
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
22
24
|
from ..._response import (
|
|
23
25
|
to_raw_response_wrapper,
|
|
@@ -26,9 +28,12 @@ from ..._response import (
|
|
|
26
28
|
async_to_streamed_response_wrapper,
|
|
27
29
|
)
|
|
28
30
|
from ...pagination import SyncCursorPagePagination, AsyncCursorPagePagination
|
|
31
|
+
from ..._exceptions import DodoPaymentsError
|
|
29
32
|
from ..._base_client import AsyncPaginator, make_request_options
|
|
30
33
|
from ...types.webhook_details import WebhookDetails
|
|
31
34
|
from ...types.webhook_event_type import WebhookEventType
|
|
35
|
+
from ...types.unwrap_webhook_event import UnwrapWebhookEvent
|
|
36
|
+
from ...types.unsafe_unwrap_webhook_event import UnsafeUnwrapWebhookEvent
|
|
32
37
|
from ...types.webhook_retrieve_secret_response import WebhookRetrieveSecretResponse
|
|
33
38
|
|
|
34
39
|
__all__ = ["WebhooksResource", "AsyncWebhooksResource"]
|
|
@@ -62,19 +67,19 @@ class WebhooksResource(SyncAPIResource):
|
|
|
62
67
|
self,
|
|
63
68
|
*,
|
|
64
69
|
url: str,
|
|
65
|
-
description: Optional[str] |
|
|
66
|
-
disabled: Optional[bool] |
|
|
67
|
-
filter_types: List[WebhookEventType] |
|
|
68
|
-
headers: Optional[Dict[str, str]] |
|
|
69
|
-
idempotency_key: Optional[str] |
|
|
70
|
-
metadata: Optional[Dict[str, str]] |
|
|
71
|
-
rate_limit: Optional[int] |
|
|
70
|
+
description: Optional[str] | Omit = omit,
|
|
71
|
+
disabled: Optional[bool] | Omit = omit,
|
|
72
|
+
filter_types: List[WebhookEventType] | Omit = omit,
|
|
73
|
+
headers: Optional[Dict[str, str]] | Omit = omit,
|
|
74
|
+
idempotency_key: Optional[str] | Omit = omit,
|
|
75
|
+
metadata: Optional[Dict[str, str]] | Omit = omit,
|
|
76
|
+
rate_limit: Optional[int] | Omit = omit,
|
|
72
77
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
73
78
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
74
79
|
extra_headers: Headers | None = None,
|
|
75
80
|
extra_query: Query | None = None,
|
|
76
81
|
extra_body: Body | None = None,
|
|
77
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
82
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
78
83
|
) -> WebhookDetails:
|
|
79
84
|
"""
|
|
80
85
|
Create a new webhook
|
|
@@ -134,7 +139,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
134
139
|
extra_headers: Headers | None = None,
|
|
135
140
|
extra_query: Query | None = None,
|
|
136
141
|
extra_body: Body | None = None,
|
|
137
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
142
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
138
143
|
) -> WebhookDetails:
|
|
139
144
|
"""
|
|
140
145
|
Get a webhook by id
|
|
@@ -162,18 +167,18 @@ class WebhooksResource(SyncAPIResource):
|
|
|
162
167
|
self,
|
|
163
168
|
webhook_id: str,
|
|
164
169
|
*,
|
|
165
|
-
description: Optional[str] |
|
|
166
|
-
disabled: Optional[bool] |
|
|
167
|
-
filter_types: Optional[List[WebhookEventType]] |
|
|
168
|
-
metadata: Optional[Dict[str, str]] |
|
|
169
|
-
rate_limit: Optional[int] |
|
|
170
|
-
url: Optional[str] |
|
|
170
|
+
description: Optional[str] | Omit = omit,
|
|
171
|
+
disabled: Optional[bool] | Omit = omit,
|
|
172
|
+
filter_types: Optional[List[WebhookEventType]] | Omit = omit,
|
|
173
|
+
metadata: Optional[Dict[str, str]] | Omit = omit,
|
|
174
|
+
rate_limit: Optional[int] | Omit = omit,
|
|
175
|
+
url: Optional[str] | Omit = omit,
|
|
171
176
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
172
177
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
173
178
|
extra_headers: Headers | None = None,
|
|
174
179
|
extra_query: Query | None = None,
|
|
175
180
|
extra_body: Body | None = None,
|
|
176
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
181
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
177
182
|
) -> WebhookDetails:
|
|
178
183
|
"""
|
|
179
184
|
Patch a webhook by id
|
|
@@ -225,14 +230,14 @@ class WebhooksResource(SyncAPIResource):
|
|
|
225
230
|
def list(
|
|
226
231
|
self,
|
|
227
232
|
*,
|
|
228
|
-
iterator: Optional[str] |
|
|
229
|
-
limit: Optional[int] |
|
|
233
|
+
iterator: Optional[str] | Omit = omit,
|
|
234
|
+
limit: Optional[int] | Omit = omit,
|
|
230
235
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
231
236
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
232
237
|
extra_headers: Headers | None = None,
|
|
233
238
|
extra_query: Query | None = None,
|
|
234
239
|
extra_body: Body | None = None,
|
|
235
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
240
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
236
241
|
) -> SyncCursorPagePagination[WebhookDetails]:
|
|
237
242
|
"""
|
|
238
243
|
List all webhooks
|
|
@@ -278,7 +283,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
278
283
|
extra_headers: Headers | None = None,
|
|
279
284
|
extra_query: Query | None = None,
|
|
280
285
|
extra_body: Body | None = None,
|
|
281
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
286
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
282
287
|
) -> None:
|
|
283
288
|
"""
|
|
284
289
|
Delete a webhook by id
|
|
@@ -312,7 +317,7 @@ class WebhooksResource(SyncAPIResource):
|
|
|
312
317
|
extra_headers: Headers | None = None,
|
|
313
318
|
extra_query: Query | None = None,
|
|
314
319
|
extra_body: Body | None = None,
|
|
315
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
320
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
316
321
|
) -> WebhookRetrieveSecretResponse:
|
|
317
322
|
"""
|
|
318
323
|
Get webhook secret by id
|
|
@@ -336,6 +341,41 @@ class WebhooksResource(SyncAPIResource):
|
|
|
336
341
|
cast_to=WebhookRetrieveSecretResponse,
|
|
337
342
|
)
|
|
338
343
|
|
|
344
|
+
def unsafe_unwrap(self, payload: str) -> UnsafeUnwrapWebhookEvent:
|
|
345
|
+
return cast(
|
|
346
|
+
UnsafeUnwrapWebhookEvent,
|
|
347
|
+
construct_type(
|
|
348
|
+
type_=UnsafeUnwrapWebhookEvent,
|
|
349
|
+
value=json.loads(payload),
|
|
350
|
+
),
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
def unwrap(self, payload: str, *, headers: Mapping[str, str], key: str | bytes | None = None) -> UnwrapWebhookEvent:
|
|
354
|
+
try:
|
|
355
|
+
from standardwebhooks import Webhook
|
|
356
|
+
except ImportError as exc:
|
|
357
|
+
raise DodoPaymentsError("You need to install `dodopayments[webhooks]` to use this method") from exc
|
|
358
|
+
|
|
359
|
+
if key is None:
|
|
360
|
+
key = self._client.webhook_key
|
|
361
|
+
if key is None:
|
|
362
|
+
raise ValueError(
|
|
363
|
+
"Cannot verify a webhook without a key on either the client's webhook_key or passed in as an argument"
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
if not isinstance(headers, dict):
|
|
367
|
+
headers = dict(headers)
|
|
368
|
+
|
|
369
|
+
Webhook(key).verify(payload, headers)
|
|
370
|
+
|
|
371
|
+
return cast(
|
|
372
|
+
UnwrapWebhookEvent,
|
|
373
|
+
construct_type(
|
|
374
|
+
type_=UnwrapWebhookEvent,
|
|
375
|
+
value=json.loads(payload),
|
|
376
|
+
),
|
|
377
|
+
)
|
|
378
|
+
|
|
339
379
|
|
|
340
380
|
class AsyncWebhooksResource(AsyncAPIResource):
|
|
341
381
|
@cached_property
|
|
@@ -365,19 +405,19 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
365
405
|
self,
|
|
366
406
|
*,
|
|
367
407
|
url: str,
|
|
368
|
-
description: Optional[str] |
|
|
369
|
-
disabled: Optional[bool] |
|
|
370
|
-
filter_types: List[WebhookEventType] |
|
|
371
|
-
headers: Optional[Dict[str, str]] |
|
|
372
|
-
idempotency_key: Optional[str] |
|
|
373
|
-
metadata: Optional[Dict[str, str]] |
|
|
374
|
-
rate_limit: Optional[int] |
|
|
408
|
+
description: Optional[str] | Omit = omit,
|
|
409
|
+
disabled: Optional[bool] | Omit = omit,
|
|
410
|
+
filter_types: List[WebhookEventType] | Omit = omit,
|
|
411
|
+
headers: Optional[Dict[str, str]] | Omit = omit,
|
|
412
|
+
idempotency_key: Optional[str] | Omit = omit,
|
|
413
|
+
metadata: Optional[Dict[str, str]] | Omit = omit,
|
|
414
|
+
rate_limit: Optional[int] | Omit = omit,
|
|
375
415
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
376
416
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
377
417
|
extra_headers: Headers | None = None,
|
|
378
418
|
extra_query: Query | None = None,
|
|
379
419
|
extra_body: Body | None = None,
|
|
380
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
420
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
381
421
|
) -> WebhookDetails:
|
|
382
422
|
"""
|
|
383
423
|
Create a new webhook
|
|
@@ -437,7 +477,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
437
477
|
extra_headers: Headers | None = None,
|
|
438
478
|
extra_query: Query | None = None,
|
|
439
479
|
extra_body: Body | None = None,
|
|
440
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
480
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
441
481
|
) -> WebhookDetails:
|
|
442
482
|
"""
|
|
443
483
|
Get a webhook by id
|
|
@@ -465,18 +505,18 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
465
505
|
self,
|
|
466
506
|
webhook_id: str,
|
|
467
507
|
*,
|
|
468
|
-
description: Optional[str] |
|
|
469
|
-
disabled: Optional[bool] |
|
|
470
|
-
filter_types: Optional[List[WebhookEventType]] |
|
|
471
|
-
metadata: Optional[Dict[str, str]] |
|
|
472
|
-
rate_limit: Optional[int] |
|
|
473
|
-
url: Optional[str] |
|
|
508
|
+
description: Optional[str] | Omit = omit,
|
|
509
|
+
disabled: Optional[bool] | Omit = omit,
|
|
510
|
+
filter_types: Optional[List[WebhookEventType]] | Omit = omit,
|
|
511
|
+
metadata: Optional[Dict[str, str]] | Omit = omit,
|
|
512
|
+
rate_limit: Optional[int] | Omit = omit,
|
|
513
|
+
url: Optional[str] | Omit = omit,
|
|
474
514
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
475
515
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
476
516
|
extra_headers: Headers | None = None,
|
|
477
517
|
extra_query: Query | None = None,
|
|
478
518
|
extra_body: Body | None = None,
|
|
479
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
519
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
480
520
|
) -> WebhookDetails:
|
|
481
521
|
"""
|
|
482
522
|
Patch a webhook by id
|
|
@@ -528,14 +568,14 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
528
568
|
def list(
|
|
529
569
|
self,
|
|
530
570
|
*,
|
|
531
|
-
iterator: Optional[str] |
|
|
532
|
-
limit: Optional[int] |
|
|
571
|
+
iterator: Optional[str] | Omit = omit,
|
|
572
|
+
limit: Optional[int] | Omit = omit,
|
|
533
573
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
534
574
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
535
575
|
extra_headers: Headers | None = None,
|
|
536
576
|
extra_query: Query | None = None,
|
|
537
577
|
extra_body: Body | None = None,
|
|
538
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
578
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
539
579
|
) -> AsyncPaginator[WebhookDetails, AsyncCursorPagePagination[WebhookDetails]]:
|
|
540
580
|
"""
|
|
541
581
|
List all webhooks
|
|
@@ -581,7 +621,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
581
621
|
extra_headers: Headers | None = None,
|
|
582
622
|
extra_query: Query | None = None,
|
|
583
623
|
extra_body: Body | None = None,
|
|
584
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
624
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
585
625
|
) -> None:
|
|
586
626
|
"""
|
|
587
627
|
Delete a webhook by id
|
|
@@ -615,7 +655,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
615
655
|
extra_headers: Headers | None = None,
|
|
616
656
|
extra_query: Query | None = None,
|
|
617
657
|
extra_body: Body | None = None,
|
|
618
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
658
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
619
659
|
) -> WebhookRetrieveSecretResponse:
|
|
620
660
|
"""
|
|
621
661
|
Get webhook secret by id
|
|
@@ -639,6 +679,41 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|
|
639
679
|
cast_to=WebhookRetrieveSecretResponse,
|
|
640
680
|
)
|
|
641
681
|
|
|
682
|
+
def unsafe_unwrap(self, payload: str) -> UnsafeUnwrapWebhookEvent:
|
|
683
|
+
return cast(
|
|
684
|
+
UnsafeUnwrapWebhookEvent,
|
|
685
|
+
construct_type(
|
|
686
|
+
type_=UnsafeUnwrapWebhookEvent,
|
|
687
|
+
value=json.loads(payload),
|
|
688
|
+
),
|
|
689
|
+
)
|
|
690
|
+
|
|
691
|
+
def unwrap(self, payload: str, *, headers: Mapping[str, str], key: str | bytes | None = None) -> UnwrapWebhookEvent:
|
|
692
|
+
try:
|
|
693
|
+
from standardwebhooks import Webhook
|
|
694
|
+
except ImportError as exc:
|
|
695
|
+
raise DodoPaymentsError("You need to install `dodopayments[webhooks]` to use this method") from exc
|
|
696
|
+
|
|
697
|
+
if key is None:
|
|
698
|
+
key = self._client.webhook_key
|
|
699
|
+
if key is None:
|
|
700
|
+
raise ValueError(
|
|
701
|
+
"Cannot verify a webhook without a key on either the client's webhook_key or passed in as an argument"
|
|
702
|
+
)
|
|
703
|
+
|
|
704
|
+
if not isinstance(headers, dict):
|
|
705
|
+
headers = dict(headers)
|
|
706
|
+
|
|
707
|
+
Webhook(key).verify(payload, headers)
|
|
708
|
+
|
|
709
|
+
return cast(
|
|
710
|
+
UnwrapWebhookEvent,
|
|
711
|
+
construct_type(
|
|
712
|
+
type_=UnwrapWebhookEvent,
|
|
713
|
+
value=json.loads(payload),
|
|
714
|
+
),
|
|
715
|
+
)
|
|
716
|
+
|
|
642
717
|
|
|
643
718
|
class WebhooksResourceWithRawResponse:
|
|
644
719
|
def __init__(self, webhooks: WebhooksResource) -> None:
|
dodopayments/types/__init__.py
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from .brand import Brand as Brand
|
|
6
|
+
from .event import Event as Event
|
|
7
|
+
from .meter import Meter as Meter
|
|
6
8
|
from .price import Price as Price
|
|
7
9
|
from .refund import Refund as Refund
|
|
8
10
|
from .dispute import Dispute as Dispute
|
|
@@ -15,6 +17,7 @@ from .get_dispute import GetDispute as GetDispute
|
|
|
15
17
|
from .license_key import LicenseKey as LicenseKey
|
|
16
18
|
from .price_param import PriceParam as PriceParam
|
|
17
19
|
from .country_code import CountryCode as CountryCode
|
|
20
|
+
from .meter_filter import MeterFilter as MeterFilter
|
|
18
21
|
from .subscription import Subscription as Subscription
|
|
19
22
|
from .tax_category import TaxCategory as TaxCategory
|
|
20
23
|
from .discount_type import DiscountType as DiscountType
|
|
@@ -27,8 +30,13 @@ from .dispute_status import DisputeStatus as DisputeStatus
|
|
|
27
30
|
from .billing_address import BillingAddress as BillingAddress
|
|
28
31
|
from .webhook_details import WebhookDetails as WebhookDetails
|
|
29
32
|
from .addon_list_params import AddonListParams as AddonListParams
|
|
33
|
+
from .event_input_param import EventInputParam as EventInputParam
|
|
34
|
+
from .meter_aggregation import MeterAggregation as MeterAggregation
|
|
35
|
+
from .meter_list_params import MeterListParams as MeterListParams
|
|
36
|
+
from .add_meter_to_price import AddMeterToPrice as AddMeterToPrice
|
|
30
37
|
from .attach_addon_param import AttachAddonParam as AttachAddonParam
|
|
31
38
|
from .license_key_status import LicenseKeyStatus as LicenseKeyStatus
|
|
39
|
+
from .meter_filter_param import MeterFilterParam as MeterFilterParam
|
|
32
40
|
from .new_customer_param import NewCustomerParam as NewCustomerParam
|
|
33
41
|
from .payout_list_params import PayoutListParams as PayoutListParams
|
|
34
42
|
from .refund_list_params import RefundListParams as RefundListParams
|
|
@@ -39,6 +47,7 @@ from .brand_create_params import BrandCreateParams as BrandCreateParams
|
|
|
39
47
|
from .brand_list_response import BrandListResponse as BrandListResponse
|
|
40
48
|
from .brand_update_params import BrandUpdateParams as BrandUpdateParams
|
|
41
49
|
from .dispute_list_params import DisputeListParams as DisputeListParams
|
|
50
|
+
from .meter_create_params import MeterCreateParams as MeterCreateParams
|
|
42
51
|
from .payment_list_params import PaymentListParams as PaymentListParams
|
|
43
52
|
from .product_list_params import ProductListParams as ProductListParams
|
|
44
53
|
from .subscription_status import SubscriptionStatus as SubscriptionStatus
|
|
@@ -50,6 +59,8 @@ from .license_key_instance import LicenseKeyInstance as LicenseKeyInstance
|
|
|
50
59
|
from .payment_method_types import PaymentMethodTypes as PaymentMethodTypes
|
|
51
60
|
from .payout_list_response import PayoutListResponse as PayoutListResponse
|
|
52
61
|
from .refund_create_params import RefundCreateParams as RefundCreateParams
|
|
62
|
+
from .refund_list_response import RefundListResponse as RefundListResponse
|
|
63
|
+
from .unwrap_webhook_event import UnwrapWebhookEvent as UnwrapWebhookEvent
|
|
53
64
|
from .billing_address_param import BillingAddressParam as BillingAddressParam
|
|
54
65
|
from .dispute_list_response import DisputeListResponse as DisputeListResponse
|
|
55
66
|
from .payment_create_params import PaymentCreateParams as PaymentCreateParams
|
|
@@ -64,18 +75,26 @@ from .customer_request_param import CustomerRequestParam as CustomerRequestParam
|
|
|
64
75
|
from .customer_update_params import CustomerUpdateParams as CustomerUpdateParams
|
|
65
76
|
from .discount_create_params import DiscountCreateParams as DiscountCreateParams
|
|
66
77
|
from .discount_update_params import DiscountUpdateParams as DiscountUpdateParams
|
|
78
|
+
from .checkout_session_status import CheckoutSessionStatus as CheckoutSessionStatus
|
|
67
79
|
from .customer_portal_session import CustomerPortalSession as CustomerPortalSession
|
|
68
80
|
from .license_activate_params import LicenseActivateParams as LicenseActivateParams
|
|
69
81
|
from .license_key_list_params import LicenseKeyListParams as LicenseKeyListParams
|
|
70
82
|
from .license_validate_params import LicenseValidateParams as LicenseValidateParams
|
|
83
|
+
from .meter_aggregation_param import MeterAggregationParam as MeterAggregationParam
|
|
71
84
|
from .payment_create_response import PaymentCreateResponse as PaymentCreateResponse
|
|
85
|
+
from .usage_event_list_params import UsageEventListParams as UsageEventListParams
|
|
86
|
+
from .add_meter_to_price_param import AddMeterToPriceParam as AddMeterToPriceParam
|
|
72
87
|
from .addon_cart_response_item import AddonCartResponseItem as AddonCartResponseItem
|
|
73
88
|
from .customer_limited_details import CustomerLimitedDetails as CustomerLimitedDetails
|
|
74
89
|
from .subscription_list_params import SubscriptionListParams as SubscriptionListParams
|
|
75
90
|
from .checkout_session_response import CheckoutSessionResponse as CheckoutSessionResponse
|
|
91
|
+
from .dispute_won_webhook_event import DisputeWonWebhookEvent as DisputeWonWebhookEvent
|
|
92
|
+
from .license_activate_response import LicenseActivateResponse as LicenseActivateResponse
|
|
76
93
|
from .license_deactivate_params import LicenseDeactivateParams as LicenseDeactivateParams
|
|
77
94
|
from .license_key_update_params import LicenseKeyUpdateParams as LicenseKeyUpdateParams
|
|
78
95
|
from .license_validate_response import LicenseValidateResponse as LicenseValidateResponse
|
|
96
|
+
from .usage_event_ingest_params import UsageEventIngestParams as UsageEventIngestParams
|
|
97
|
+
from .dispute_lost_webhook_event import DisputeLostWebhookEvent as DisputeLostWebhookEvent
|
|
79
98
|
from .license_key_duration_param import LicenseKeyDurationParam as LicenseKeyDurationParam
|
|
80
99
|
from .one_time_product_cart_item import OneTimeProductCartItem as OneTimeProductCartItem
|
|
81
100
|
from .subscription_charge_params import SubscriptionChargeParams as SubscriptionChargeParams
|
|
@@ -83,20 +102,49 @@ from .subscription_create_params import SubscriptionCreateParams as Subscription
|
|
|
83
102
|
from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse
|
|
84
103
|
from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams
|
|
85
104
|
from .product_update_files_params import ProductUpdateFilesParams as ProductUpdateFilesParams
|
|
105
|
+
from .refund_failed_webhook_event import RefundFailedWebhookEvent as RefundFailedWebhookEvent
|
|
106
|
+
from .unsafe_unwrap_webhook_event import UnsafeUnwrapWebhookEvent as UnsafeUnwrapWebhookEvent
|
|
107
|
+
from .usage_event_ingest_response import UsageEventIngestResponse as UsageEventIngestResponse
|
|
86
108
|
from .addon_update_images_response import AddonUpdateImagesResponse as AddonUpdateImagesResponse
|
|
87
109
|
from .brand_update_images_response import BrandUpdateImagesResponse as BrandUpdateImagesResponse
|
|
110
|
+
from .dispute_opened_webhook_event import DisputeOpenedWebhookEvent as DisputeOpenedWebhookEvent
|
|
88
111
|
from .on_demand_subscription_param import OnDemandSubscriptionParam as OnDemandSubscriptionParam
|
|
112
|
+
from .payment_failed_webhook_event import PaymentFailedWebhookEvent as PaymentFailedWebhookEvent
|
|
89
113
|
from .subscription_charge_response import SubscriptionChargeResponse as SubscriptionChargeResponse
|
|
90
114
|
from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse
|
|
115
|
+
from .dispute_expired_webhook_event import DisputeExpiredWebhookEvent as DisputeExpiredWebhookEvent
|
|
91
116
|
from .product_update_files_response import ProductUpdateFilesResponse as ProductUpdateFilesResponse
|
|
92
117
|
from .attach_existing_customer_param import AttachExistingCustomerParam as AttachExistingCustomerParam
|
|
93
118
|
from .checkout_session_create_params import CheckoutSessionCreateParams as CheckoutSessionCreateParams
|
|
119
|
+
from .dispute_accepted_webhook_event import DisputeAcceptedWebhookEvent as DisputeAcceptedWebhookEvent
|
|
120
|
+
from .refund_succeeded_webhook_event import RefundSucceededWebhookEvent as RefundSucceededWebhookEvent
|
|
121
|
+
from .dispute_cancelled_webhook_event import DisputeCancelledWebhookEvent as DisputeCancelledWebhookEvent
|
|
122
|
+
from .payment_cancelled_webhook_event import PaymentCancelledWebhookEvent as PaymentCancelledWebhookEvent
|
|
123
|
+
from .payment_succeeded_webhook_event import PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent
|
|
94
124
|
from .subscription_change_plan_params import SubscriptionChangePlanParams as SubscriptionChangePlanParams
|
|
125
|
+
from .dispute_challenged_webhook_event import DisputeChallengedWebhookEvent as DisputeChallengedWebhookEvent
|
|
95
126
|
from .license_key_instance_list_params import LicenseKeyInstanceListParams as LicenseKeyInstanceListParams
|
|
96
127
|
from .one_time_product_cart_item_param import OneTimeProductCartItemParam as OneTimeProductCartItemParam
|
|
128
|
+
from .payment_processing_webhook_event import PaymentProcessingWebhookEvent as PaymentProcessingWebhookEvent
|
|
97
129
|
from .webhook_retrieve_secret_response import WebhookRetrieveSecretResponse as WebhookRetrieveSecretResponse
|
|
130
|
+
from .license_key_created_webhook_event import LicenseKeyCreatedWebhookEvent as LicenseKeyCreatedWebhookEvent
|
|
131
|
+
from .subscription_active_webhook_event import SubscriptionActiveWebhookEvent as SubscriptionActiveWebhookEvent
|
|
132
|
+
from .subscription_failed_webhook_event import SubscriptionFailedWebhookEvent as SubscriptionFailedWebhookEvent
|
|
98
133
|
from .license_key_instance_update_params import LicenseKeyInstanceUpdateParams as LicenseKeyInstanceUpdateParams
|
|
134
|
+
from .subscription_expired_webhook_event import SubscriptionExpiredWebhookEvent as SubscriptionExpiredWebhookEvent
|
|
135
|
+
from .subscription_on_hold_webhook_event import SubscriptionOnHoldWebhookEvent as SubscriptionOnHoldWebhookEvent
|
|
136
|
+
from .subscription_renewed_webhook_event import SubscriptionRenewedWebhookEvent as SubscriptionRenewedWebhookEvent
|
|
99
137
|
from .payment_retrieve_line_items_response import PaymentRetrieveLineItemsResponse as PaymentRetrieveLineItemsResponse
|
|
138
|
+
from .subscription_cancelled_webhook_event import SubscriptionCancelledWebhookEvent as SubscriptionCancelledWebhookEvent
|
|
100
139
|
from .misc_list_supported_countries_response import (
|
|
101
140
|
MiscListSupportedCountriesResponse as MiscListSupportedCountriesResponse,
|
|
102
141
|
)
|
|
142
|
+
from .subscription_plan_changed_webhook_event import (
|
|
143
|
+
SubscriptionPlanChangedWebhookEvent as SubscriptionPlanChangedWebhookEvent,
|
|
144
|
+
)
|
|
145
|
+
from .subscription_retrieve_usage_history_params import (
|
|
146
|
+
SubscriptionRetrieveUsageHistoryParams as SubscriptionRetrieveUsageHistoryParams,
|
|
147
|
+
)
|
|
148
|
+
from .subscription_retrieve_usage_history_response import (
|
|
149
|
+
SubscriptionRetrieveUsageHistoryResponse as SubscriptionRetrieveUsageHistoryResponse,
|
|
150
|
+
)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["AddMeterToPrice"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AddMeterToPrice(BaseModel):
|
|
11
|
+
meter_id: str
|
|
12
|
+
|
|
13
|
+
price_per_unit: str
|
|
14
|
+
"""The price per unit in lowest denomination.
|
|
15
|
+
|
|
16
|
+
Must be greater than zero. Supports up to 5 digits before decimal point and 12
|
|
17
|
+
decimal places.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
description: Optional[str] = None
|
|
21
|
+
"""Meter description. Will ignored on Request, but will be shown in response"""
|
|
22
|
+
|
|
23
|
+
free_threshold: Optional[int] = None
|
|
24
|
+
|
|
25
|
+
measurement_unit: Optional[str] = None
|
|
26
|
+
"""Meter measurement unit. Will ignored on Request, but will be shown in response"""
|
|
27
|
+
|
|
28
|
+
name: Optional[str] = None
|
|
29
|
+
"""Meter name. Will ignored on Request, but will be shown in response"""
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
__all__ = ["AddMeterToPriceParam"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AddMeterToPriceParam(TypedDict, total=False):
|
|
12
|
+
meter_id: Required[str]
|
|
13
|
+
|
|
14
|
+
price_per_unit: Required[str]
|
|
15
|
+
"""The price per unit in lowest denomination.
|
|
16
|
+
|
|
17
|
+
Must be greater than zero. Supports up to 5 digits before decimal point and 12
|
|
18
|
+
decimal places.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
description: Optional[str]
|
|
22
|
+
"""Meter description. Will ignored on Request, but will be shown in response"""
|
|
23
|
+
|
|
24
|
+
free_threshold: Optional[int]
|
|
25
|
+
|
|
26
|
+
measurement_unit: Optional[str]
|
|
27
|
+
"""Meter measurement unit. Will ignored on Request, but will be shown in response"""
|
|
28
|
+
|
|
29
|
+
name: Optional[str]
|
|
30
|
+
"""Meter name. Will ignored on Request, but will be shown in response"""
|
|
@@ -57,6 +57,9 @@ class CheckoutSessionCreateParams(TypedDict, total=False):
|
|
|
57
57
|
|
|
58
58
|
feature_flags: FeatureFlags
|
|
59
59
|
|
|
60
|
+
force_3ds: Optional[bool]
|
|
61
|
+
"""Override merchant default 3DS behaviour for this session"""
|
|
62
|
+
|
|
60
63
|
metadata: Optional[Dict[str, str]]
|
|
61
64
|
"""Additional metadata associated with the payment.
|
|
62
65
|
|
|
@@ -111,6 +114,9 @@ class BillingAddress(TypedDict, total=False):
|
|
|
111
114
|
|
|
112
115
|
|
|
113
116
|
class Customization(TypedDict, total=False):
|
|
117
|
+
force_language: Optional[str]
|
|
118
|
+
"""Force the checkout interface to render in a specific language (e.g. `en`, `es`)"""
|
|
119
|
+
|
|
114
120
|
show_on_demand_tag: bool
|
|
115
121
|
"""Show on demand tag
|
|
116
122
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .intent_status import IntentStatus
|
|
8
|
+
|
|
9
|
+
__all__ = ["CheckoutSessionStatus"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CheckoutSessionStatus(BaseModel):
|
|
13
|
+
id: str
|
|
14
|
+
"""Id of the checkout session"""
|
|
15
|
+
|
|
16
|
+
created_at: datetime
|
|
17
|
+
"""Created at timestamp"""
|
|
18
|
+
|
|
19
|
+
customer_email: Optional[str] = None
|
|
20
|
+
"""Customer email: prefers payment's customer, falls back to session"""
|
|
21
|
+
|
|
22
|
+
customer_name: Optional[str] = None
|
|
23
|
+
"""Customer name: prefers payment's customer, falls back to session"""
|
|
24
|
+
|
|
25
|
+
payment_id: Optional[str] = None
|
|
26
|
+
"""Id of the payment created by the checkout sessions.
|
|
27
|
+
|
|
28
|
+
Null if checkout sessions is still at the details collection stage.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
payment_status: Optional[IntentStatus] = None
|
|
32
|
+
"""status of the payment.
|
|
33
|
+
|
|
34
|
+
Null if checkout sessions is still at the details collection stage.
|
|
35
|
+
"""
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
3
5
|
from .._models import BaseModel
|
|
4
6
|
|
|
5
7
|
__all__ = ["CustomerLimitedDetails"]
|
|
@@ -14,3 +16,6 @@ class CustomerLimitedDetails(BaseModel):
|
|
|
14
16
|
|
|
15
17
|
name: str
|
|
16
18
|
"""Full name of the customer"""
|
|
19
|
+
|
|
20
|
+
phone_number: Optional[str] = None
|
|
21
|
+
"""Phone number of the customer"""
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from .customer_wallet import CustomerWallet as CustomerWallet
|
|
6
|
+
from .wallet_list_response import WalletListResponse as WalletListResponse
|
|
5
7
|
from .customer_portal_create_params import CustomerPortalCreateParams as CustomerPortalCreateParams
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
from ..currency import Currency
|
|
7
|
+
|
|
8
|
+
__all__ = ["CustomerWallet"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CustomerWallet(BaseModel):
|
|
12
|
+
balance: int
|
|
13
|
+
|
|
14
|
+
created_at: datetime
|
|
15
|
+
|
|
16
|
+
currency: Currency
|
|
17
|
+
|
|
18
|
+
customer_id: str
|
|
19
|
+
|
|
20
|
+
updated_at: datetime
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
from .customer_wallet import CustomerWallet
|
|
7
|
+
|
|
8
|
+
__all__ = ["WalletListResponse"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class WalletListResponse(BaseModel):
|
|
12
|
+
items: List[CustomerWallet]
|
|
13
|
+
|
|
14
|
+
total_balance_usd: int
|
|
15
|
+
"""Sum of all wallet balances converted to USD (in smallest unit)"""
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .ledger_entry_list_params import LedgerEntryListParams as LedgerEntryListParams
|
|
6
|
+
from .ledger_entry_create_params import LedgerEntryCreateParams as LedgerEntryCreateParams
|
|
7
|
+
from .customer_wallet_transaction import CustomerWalletTransaction as CustomerWalletTransaction
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
7
|
+
from ...._models import BaseModel
|
|
8
|
+
from ...currency import Currency
|
|
9
|
+
|
|
10
|
+
__all__ = ["CustomerWalletTransaction"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CustomerWalletTransaction(BaseModel):
|
|
14
|
+
id: str
|
|
15
|
+
|
|
16
|
+
after_balance: int
|
|
17
|
+
|
|
18
|
+
amount: int
|
|
19
|
+
|
|
20
|
+
before_balance: int
|
|
21
|
+
|
|
22
|
+
business_id: str
|
|
23
|
+
|
|
24
|
+
created_at: datetime
|
|
25
|
+
|
|
26
|
+
currency: Currency
|
|
27
|
+
|
|
28
|
+
customer_id: str
|
|
29
|
+
|
|
30
|
+
event_type: Literal[
|
|
31
|
+
"payment", "payment_reversal", "refund", "refund_reversal", "dispute", "dispute_reversal", "merchant_adjustment"
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
is_credit: bool
|
|
35
|
+
|
|
36
|
+
reason: Optional[str] = None
|
|
37
|
+
|
|
38
|
+
reference_object_id: Optional[str] = None
|