dodopayments 1.20.0__py3-none-any.whl → 1.22.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.

Potentially problematic release.


This version of dodopayments might be problematic. Click here for more details.

dodopayments/_client.py CHANGED
@@ -84,14 +84,14 @@ class DodoPayments(SyncAPIClient):
84
84
  with_streaming_response: DodoPaymentsWithStreamedResponse
85
85
 
86
86
  # client options
87
- api_key: str
87
+ bearer_token: str
88
88
 
89
89
  _environment: Literal["live_mode", "test_mode"] | NotGiven
90
90
 
91
91
  def __init__(
92
92
  self,
93
93
  *,
94
- api_key: str | None = None,
94
+ bearer_token: str | None = None,
95
95
  environment: Literal["live_mode", "test_mode"] | NotGiven = NOT_GIVEN,
96
96
  base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
97
97
  timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
@@ -114,15 +114,15 @@ class DodoPayments(SyncAPIClient):
114
114
  ) -> None:
115
115
  """Construct a new synchronous DodoPayments client instance.
116
116
 
117
- This automatically infers the `api_key` argument from the `DODO_PAYMENTS_API_KEY` environment variable if it is not provided.
117
+ This automatically infers the `bearer_token` argument from the `DODO_PAYMENTS_API_KEY` environment variable if it is not provided.
118
118
  """
119
- if api_key is None:
120
- api_key = os.environ.get("DODO_PAYMENTS_API_KEY")
121
- if api_key is None:
119
+ if bearer_token is None:
120
+ bearer_token = os.environ.get("DODO_PAYMENTS_API_KEY")
121
+ if bearer_token is None:
122
122
  raise DodoPaymentsError(
123
- "The api_key client option must be set either by passing api_key to the client or by setting the DODO_PAYMENTS_API_KEY environment variable"
123
+ "The bearer_token client option must be set either by passing bearer_token to the client or by setting the DODO_PAYMENTS_API_KEY environment variable"
124
124
  )
125
- self.api_key = api_key
125
+ self.bearer_token = bearer_token
126
126
 
127
127
  self._environment = environment
128
128
 
@@ -187,8 +187,8 @@ class DodoPayments(SyncAPIClient):
187
187
  @property
188
188
  @override
189
189
  def auth_headers(self) -> dict[str, str]:
190
- api_key = self.api_key
191
- return {"Authorization": f"Bearer {api_key}"}
190
+ bearer_token = self.bearer_token
191
+ return {"Authorization": f"Bearer {bearer_token}"}
192
192
 
193
193
  @property
194
194
  @override
@@ -202,7 +202,7 @@ class DodoPayments(SyncAPIClient):
202
202
  def copy(
203
203
  self,
204
204
  *,
205
- api_key: str | None = None,
205
+ bearer_token: str | None = None,
206
206
  environment: Literal["live_mode", "test_mode"] | None = None,
207
207
  base_url: str | httpx.URL | None = None,
208
208
  timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
@@ -237,7 +237,7 @@ class DodoPayments(SyncAPIClient):
237
237
 
238
238
  http_client = http_client or self._client
239
239
  return self.__class__(
240
- api_key=api_key or self.api_key,
240
+ bearer_token=bearer_token or self.bearer_token,
241
241
  base_url=base_url or self.base_url,
242
242
  environment=environment or self._environment,
243
243
  timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -306,14 +306,14 @@ class AsyncDodoPayments(AsyncAPIClient):
306
306
  with_streaming_response: AsyncDodoPaymentsWithStreamedResponse
307
307
 
308
308
  # client options
309
- api_key: str
309
+ bearer_token: str
310
310
 
311
311
  _environment: Literal["live_mode", "test_mode"] | NotGiven
312
312
 
313
313
  def __init__(
314
314
  self,
315
315
  *,
316
- api_key: str | None = None,
316
+ bearer_token: str | None = None,
317
317
  environment: Literal["live_mode", "test_mode"] | NotGiven = NOT_GIVEN,
318
318
  base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
319
319
  timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
@@ -336,15 +336,15 @@ class AsyncDodoPayments(AsyncAPIClient):
336
336
  ) -> None:
337
337
  """Construct a new async AsyncDodoPayments client instance.
338
338
 
339
- This automatically infers the `api_key` argument from the `DODO_PAYMENTS_API_KEY` environment variable if it is not provided.
339
+ This automatically infers the `bearer_token` argument from the `DODO_PAYMENTS_API_KEY` environment variable if it is not provided.
340
340
  """
341
- if api_key is None:
342
- api_key = os.environ.get("DODO_PAYMENTS_API_KEY")
343
- if api_key is None:
341
+ if bearer_token is None:
342
+ bearer_token = os.environ.get("DODO_PAYMENTS_API_KEY")
343
+ if bearer_token is None:
344
344
  raise DodoPaymentsError(
345
- "The api_key client option must be set either by passing api_key to the client or by setting the DODO_PAYMENTS_API_KEY environment variable"
345
+ "The bearer_token client option must be set either by passing bearer_token to the client or by setting the DODO_PAYMENTS_API_KEY environment variable"
346
346
  )
347
- self.api_key = api_key
347
+ self.bearer_token = bearer_token
348
348
 
349
349
  self._environment = environment
350
350
 
@@ -409,8 +409,8 @@ class AsyncDodoPayments(AsyncAPIClient):
409
409
  @property
410
410
  @override
411
411
  def auth_headers(self) -> dict[str, str]:
412
- api_key = self.api_key
413
- return {"Authorization": f"Bearer {api_key}"}
412
+ bearer_token = self.bearer_token
413
+ return {"Authorization": f"Bearer {bearer_token}"}
414
414
 
415
415
  @property
416
416
  @override
@@ -424,7 +424,7 @@ class AsyncDodoPayments(AsyncAPIClient):
424
424
  def copy(
425
425
  self,
426
426
  *,
427
- api_key: str | None = None,
427
+ bearer_token: str | None = None,
428
428
  environment: Literal["live_mode", "test_mode"] | None = None,
429
429
  base_url: str | httpx.URL | None = None,
430
430
  timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
@@ -459,7 +459,7 @@ class AsyncDodoPayments(AsyncAPIClient):
459
459
 
460
460
  http_client = http_client or self._client
461
461
  return self.__class__(
462
- api_key=api_key or self.api_key,
462
+ bearer_token=bearer_token or self.bearer_token,
463
463
  base_url=base_url or self.base_url,
464
464
  environment=environment or self._environment,
465
465
  timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -46,7 +46,10 @@ class LazyProxy(Generic[T], ABC):
46
46
  @property # type: ignore
47
47
  @override
48
48
  def __class__(self) -> type: # pyright: ignore
49
- proxied = self.__get_proxied__()
49
+ try:
50
+ proxied = self.__get_proxied__()
51
+ except Exception:
52
+ return type(self)
50
53
  if issubclass(type(proxied), LazyProxy):
51
54
  return type(proxied)
52
55
  return proxied.__class__
dodopayments/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "dodopayments"
4
- __version__ = "1.20.0" # x-release-please-version
4
+ __version__ = "1.22.0" # x-release-please-version
@@ -20,9 +20,10 @@ from .._response import (
20
20
  )
21
21
  from ..pagination import SyncDefaultPageNumberPagination, AsyncDefaultPageNumberPagination
22
22
  from .._base_client import AsyncPaginator, make_request_options
23
- from ..types.dispute import Dispute
24
23
  from ..types.dispute_stage import DisputeStage
25
24
  from ..types.dispute_status import DisputeStatus
25
+ from ..types.dispute_list_response import DisputeListResponse
26
+ from ..types.dispute_retrieve_response import DisputeRetrieveResponse
26
27
 
27
28
  __all__ = ["DisputesResource", "AsyncDisputesResource"]
28
29
 
@@ -57,7 +58,7 @@ class DisputesResource(SyncAPIResource):
57
58
  extra_query: Query | None = None,
58
59
  extra_body: Body | None = None,
59
60
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
60
- ) -> Dispute:
61
+ ) -> DisputeRetrieveResponse:
61
62
  """
62
63
  Args:
63
64
  extra_headers: Send extra headers
@@ -75,7 +76,7 @@ class DisputesResource(SyncAPIResource):
75
76
  options=make_request_options(
76
77
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
77
78
  ),
78
- cast_to=Dispute,
79
+ cast_to=DisputeRetrieveResponse,
79
80
  )
80
81
 
81
82
  def list(
@@ -94,7 +95,7 @@ class DisputesResource(SyncAPIResource):
94
95
  extra_query: Query | None = None,
95
96
  extra_body: Body | None = None,
96
97
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
97
- ) -> SyncDefaultPageNumberPagination[Dispute]:
98
+ ) -> SyncDefaultPageNumberPagination[DisputeListResponse]:
98
99
  """
99
100
  Args:
100
101
  created_at_gte: Get events after this created time
@@ -121,7 +122,7 @@ class DisputesResource(SyncAPIResource):
121
122
  """
122
123
  return self._get_api_list(
123
124
  "/disputes",
124
- page=SyncDefaultPageNumberPagination[Dispute],
125
+ page=SyncDefaultPageNumberPagination[DisputeListResponse],
125
126
  options=make_request_options(
126
127
  extra_headers=extra_headers,
127
128
  extra_query=extra_query,
@@ -140,7 +141,7 @@ class DisputesResource(SyncAPIResource):
140
141
  dispute_list_params.DisputeListParams,
141
142
  ),
142
143
  ),
143
- model=Dispute,
144
+ model=DisputeListResponse,
144
145
  )
145
146
 
146
147
 
@@ -174,7 +175,7 @@ class AsyncDisputesResource(AsyncAPIResource):
174
175
  extra_query: Query | None = None,
175
176
  extra_body: Body | None = None,
176
177
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
177
- ) -> Dispute:
178
+ ) -> DisputeRetrieveResponse:
178
179
  """
179
180
  Args:
180
181
  extra_headers: Send extra headers
@@ -192,7 +193,7 @@ class AsyncDisputesResource(AsyncAPIResource):
192
193
  options=make_request_options(
193
194
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
194
195
  ),
195
- cast_to=Dispute,
196
+ cast_to=DisputeRetrieveResponse,
196
197
  )
197
198
 
198
199
  def list(
@@ -211,7 +212,7 @@ class AsyncDisputesResource(AsyncAPIResource):
211
212
  extra_query: Query | None = None,
212
213
  extra_body: Body | None = None,
213
214
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
214
- ) -> AsyncPaginator[Dispute, AsyncDefaultPageNumberPagination[Dispute]]:
215
+ ) -> AsyncPaginator[DisputeListResponse, AsyncDefaultPageNumberPagination[DisputeListResponse]]:
215
216
  """
216
217
  Args:
217
218
  created_at_gte: Get events after this created time
@@ -238,7 +239,7 @@ class AsyncDisputesResource(AsyncAPIResource):
238
239
  """
239
240
  return self._get_api_list(
240
241
  "/disputes",
241
- page=AsyncDefaultPageNumberPagination[Dispute],
242
+ page=AsyncDefaultPageNumberPagination[DisputeListResponse],
242
243
  options=make_request_options(
243
244
  extra_headers=extra_headers,
244
245
  extra_query=extra_query,
@@ -257,7 +258,7 @@ class AsyncDisputesResource(AsyncAPIResource):
257
258
  dispute_list_params.DisputeListParams,
258
259
  ),
259
260
  ),
260
- model=Dispute,
261
+ model=DisputeListResponse,
261
262
  )
262
263
 
263
264
 
@@ -4,14 +4,18 @@ from __future__ import annotations
4
4
 
5
5
  import httpx
6
6
 
7
- from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
7
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8
8
  from ..._compat import cached_property
9
9
  from ..._resource import SyncAPIResource, AsyncAPIResource
10
10
  from ..._response import (
11
- to_raw_response_wrapper,
12
- to_streamed_response_wrapper,
13
- async_to_raw_response_wrapper,
14
- async_to_streamed_response_wrapper,
11
+ BinaryAPIResponse,
12
+ AsyncBinaryAPIResponse,
13
+ StreamedBinaryAPIResponse,
14
+ AsyncStreamedBinaryAPIResponse,
15
+ to_custom_raw_response_wrapper,
16
+ to_custom_streamed_response_wrapper,
17
+ async_to_custom_raw_response_wrapper,
18
+ async_to_custom_streamed_response_wrapper,
15
19
  )
16
20
  from ..._base_client import make_request_options
17
21
 
@@ -48,7 +52,7 @@ class PaymentsResource(SyncAPIResource):
48
52
  extra_query: Query | None = None,
49
53
  extra_body: Body | None = None,
50
54
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51
- ) -> None:
55
+ ) -> BinaryAPIResponse:
52
56
  """
53
57
  Args:
54
58
  extra_headers: Send extra headers
@@ -61,13 +65,13 @@ class PaymentsResource(SyncAPIResource):
61
65
  """
62
66
  if not payment_id:
63
67
  raise ValueError(f"Expected a non-empty value for `payment_id` but received {payment_id!r}")
64
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
68
+ extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
65
69
  return self._get(
66
70
  f"/invoices/payments/{payment_id}",
67
71
  options=make_request_options(
68
72
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
69
73
  ),
70
- cast_to=NoneType,
74
+ cast_to=BinaryAPIResponse,
71
75
  )
72
76
 
73
77
 
@@ -101,7 +105,7 @@ class AsyncPaymentsResource(AsyncAPIResource):
101
105
  extra_query: Query | None = None,
102
106
  extra_body: Body | None = None,
103
107
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
104
- ) -> None:
108
+ ) -> AsyncBinaryAPIResponse:
105
109
  """
106
110
  Args:
107
111
  extra_headers: Send extra headers
@@ -114,13 +118,13 @@ class AsyncPaymentsResource(AsyncAPIResource):
114
118
  """
115
119
  if not payment_id:
116
120
  raise ValueError(f"Expected a non-empty value for `payment_id` but received {payment_id!r}")
117
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
121
+ extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
118
122
  return await self._get(
119
123
  f"/invoices/payments/{payment_id}",
120
124
  options=make_request_options(
121
125
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
122
126
  ),
123
- cast_to=NoneType,
127
+ cast_to=AsyncBinaryAPIResponse,
124
128
  )
125
129
 
126
130
 
@@ -128,8 +132,9 @@ class PaymentsResourceWithRawResponse:
128
132
  def __init__(self, payments: PaymentsResource) -> None:
129
133
  self._payments = payments
130
134
 
131
- self.retrieve = to_raw_response_wrapper(
135
+ self.retrieve = to_custom_raw_response_wrapper(
132
136
  payments.retrieve,
137
+ BinaryAPIResponse,
133
138
  )
134
139
 
135
140
 
@@ -137,8 +142,9 @@ class AsyncPaymentsResourceWithRawResponse:
137
142
  def __init__(self, payments: AsyncPaymentsResource) -> None:
138
143
  self._payments = payments
139
144
 
140
- self.retrieve = async_to_raw_response_wrapper(
145
+ self.retrieve = async_to_custom_raw_response_wrapper(
141
146
  payments.retrieve,
147
+ AsyncBinaryAPIResponse,
142
148
  )
143
149
 
144
150
 
@@ -146,8 +152,9 @@ class PaymentsResourceWithStreamingResponse:
146
152
  def __init__(self, payments: PaymentsResource) -> None:
147
153
  self._payments = payments
148
154
 
149
- self.retrieve = to_streamed_response_wrapper(
155
+ self.retrieve = to_custom_streamed_response_wrapper(
150
156
  payments.retrieve,
157
+ StreamedBinaryAPIResponse,
151
158
  )
152
159
 
153
160
 
@@ -155,6 +162,7 @@ class AsyncPaymentsResourceWithStreamingResponse:
155
162
  def __init__(self, payments: AsyncPaymentsResource) -> None:
156
163
  self._payments = payments
157
164
 
158
- self.retrieve = async_to_streamed_response_wrapper(
165
+ self.retrieve = async_to_custom_streamed_response_wrapper(
159
166
  payments.retrieve,
167
+ AsyncStreamedBinaryAPIResponse,
160
168
  )
@@ -320,6 +320,7 @@ class SubscriptionsResource(SyncAPIResource):
320
320
  product_id: str,
321
321
  proration_billing_mode: Literal["prorated_immediately"],
322
322
  quantity: int,
323
+ addons: Optional[Iterable[subscription_change_plan_params.Addon]] | NotGiven = NOT_GIVEN,
323
324
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
324
325
  # The extra values given here take precedence over values defined on the client or passed to this method.
325
326
  extra_headers: Headers | None = None,
@@ -333,6 +334,9 @@ class SubscriptionsResource(SyncAPIResource):
333
334
 
334
335
  quantity: Number of units to subscribe for. Must be at least 1.
335
336
 
337
+ addons: Addons for the new plan. Note : Leaving this empty would remove any existing
338
+ addons
339
+
336
340
  extra_headers: Send extra headers
337
341
 
338
342
  extra_query: Add additional query parameters to the request
@@ -351,6 +355,7 @@ class SubscriptionsResource(SyncAPIResource):
351
355
  "product_id": product_id,
352
356
  "proration_billing_mode": proration_billing_mode,
353
357
  "quantity": quantity,
358
+ "addons": addons,
354
359
  },
355
360
  subscription_change_plan_params.SubscriptionChangePlanParams,
356
361
  ),
@@ -677,6 +682,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
677
682
  product_id: str,
678
683
  proration_billing_mode: Literal["prorated_immediately"],
679
684
  quantity: int,
685
+ addons: Optional[Iterable[subscription_change_plan_params.Addon]] | NotGiven = NOT_GIVEN,
680
686
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
681
687
  # The extra values given here take precedence over values defined on the client or passed to this method.
682
688
  extra_headers: Headers | None = None,
@@ -690,6 +696,9 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
690
696
 
691
697
  quantity: Number of units to subscribe for. Must be at least 1.
692
698
 
699
+ addons: Addons for the new plan. Note : Leaving this empty would remove any existing
700
+ addons
701
+
693
702
  extra_headers: Send extra headers
694
703
 
695
704
  extra_query: Add additional query parameters to the request
@@ -708,6 +717,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
708
717
  "product_id": product_id,
709
718
  "proration_billing_mode": proration_billing_mode,
710
719
  "quantity": quantity,
720
+ "addons": addons,
711
721
  },
712
722
  subscription_change_plan_params.SubscriptionChangePlanParams,
713
723
  ),
@@ -41,6 +41,7 @@ from .license_key_instance import LicenseKeyInstance as LicenseKeyInstance
41
41
  from .payout_list_response import PayoutListResponse as PayoutListResponse
42
42
  from .refund_create_params import RefundCreateParams as RefundCreateParams
43
43
  from .billing_address_param import BillingAddressParam as BillingAddressParam
44
+ from .dispute_list_response import DisputeListResponse as DisputeListResponse
44
45
  from .payment_create_params import PaymentCreateParams as PaymentCreateParams
45
46
  from .payment_list_response import PaymentListResponse as PaymentListResponse
46
47
  from .product_create_params import ProductCreateParams as ProductCreateParams
@@ -60,6 +61,7 @@ from .addon_cart_response_item import AddonCartResponseItem as AddonCartResponse
60
61
  from .customer_limited_details import CustomerLimitedDetails as CustomerLimitedDetails
61
62
  from .subscription_list_params import SubscriptionListParams as SubscriptionListParams
62
63
  from .create_new_customer_param import CreateNewCustomerParam as CreateNewCustomerParam
64
+ from .dispute_retrieve_response import DisputeRetrieveResponse as DisputeRetrieveResponse
63
65
  from .license_deactivate_params import LicenseDeactivateParams as LicenseDeactivateParams
64
66
  from .license_key_update_params import LicenseKeyUpdateParams as LicenseKeyUpdateParams
65
67
  from .license_validate_response import LicenseValidateResponse as LicenseValidateResponse
@@ -1,5 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ from typing import Optional
3
4
  from datetime import datetime
4
5
 
5
6
  from .._models import BaseModel
@@ -34,3 +35,6 @@ class Dispute(BaseModel):
34
35
 
35
36
  payment_id: str
36
37
  """The unique identifier of the payment associated with the dispute."""
38
+
39
+ remarks: Optional[str] = None
40
+ """Remarks"""
@@ -0,0 +1,36 @@
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 .dispute_stage import DisputeStage
7
+ from .dispute_status import DisputeStatus
8
+
9
+ __all__ = ["DisputeListResponse"]
10
+
11
+
12
+ class DisputeListResponse(BaseModel):
13
+ amount: str
14
+ """
15
+ The amount involved in the dispute, represented as a string to accommodate
16
+ precision.
17
+ """
18
+
19
+ business_id: str
20
+ """The unique identifier of the business involved in the dispute."""
21
+
22
+ created_at: datetime
23
+ """The timestamp of when the dispute was created, in UTC."""
24
+
25
+ currency: str
26
+ """The currency of the disputed amount, represented as an ISO 4217 currency code."""
27
+
28
+ dispute_id: str
29
+ """The unique identifier of the dispute."""
30
+
31
+ dispute_stage: DisputeStage
32
+
33
+ dispute_status: DisputeStatus
34
+
35
+ payment_id: str
36
+ """The unique identifier of the payment associated with the dispute."""
@@ -0,0 +1,46 @@
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 .dispute_stage import DisputeStage
8
+ from .dispute_status import DisputeStatus
9
+ from .customer_limited_details import CustomerLimitedDetails
10
+
11
+ __all__ = ["DisputeRetrieveResponse"]
12
+
13
+
14
+ class DisputeRetrieveResponse(BaseModel):
15
+ amount: str
16
+ """
17
+ The amount involved in the dispute, represented as a string to accommodate
18
+ precision.
19
+ """
20
+
21
+ business_id: str
22
+ """The unique identifier of the business involved in the dispute."""
23
+
24
+ created_at: datetime
25
+ """The timestamp of when the dispute was created, in UTC."""
26
+
27
+ currency: str
28
+ """The currency of the disputed amount, represented as an ISO 4217 currency code."""
29
+
30
+ customer: CustomerLimitedDetails
31
+
32
+ dispute_id: str
33
+ """The unique identifier of the dispute."""
34
+
35
+ dispute_stage: DisputeStage
36
+
37
+ dispute_status: DisputeStatus
38
+
39
+ payment_id: str
40
+ """The unique identifier of the payment associated with the dispute."""
41
+
42
+ reason: Optional[str] = None
43
+ """Reason for the dispute"""
44
+
45
+ remarks: Optional[str] = None
46
+ """Remarks"""
@@ -7,6 +7,7 @@ from .refund import Refund
7
7
  from .dispute import Dispute
8
8
  from .._models import BaseModel
9
9
  from .currency import Currency
10
+ from .country_code import CountryCode
10
11
  from .intent_status import IntentStatus
11
12
  from .billing_address import BillingAddress
12
13
  from .customer_limited_details import CustomerLimitedDetails
@@ -59,6 +60,18 @@ class Payment(BaseModel):
59
60
  (e.g. cents)
60
61
  """
61
62
 
63
+ card_issuing_country: Optional[CountryCode] = None
64
+ """ISO country code alpha2 variant"""
65
+
66
+ card_last_four: Optional[str] = None
67
+ """The last four digits of the card"""
68
+
69
+ card_network: Optional[str] = None
70
+ """Card network like VISA, MASTERCARD etc."""
71
+
72
+ card_type: Optional[str] = None
73
+ """The type of card DEBIT or CREDIT"""
74
+
62
75
  discount_id: Optional[str] = None
63
76
  """The discount id if discount is applied"""
64
77
 
@@ -2,9 +2,10 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Iterable, Optional
5
6
  from typing_extensions import Literal, Required, TypedDict
6
7
 
7
- __all__ = ["SubscriptionChangePlanParams"]
8
+ __all__ = ["SubscriptionChangePlanParams", "Addon"]
8
9
 
9
10
 
10
11
  class SubscriptionChangePlanParams(TypedDict, total=False):
@@ -15,3 +16,15 @@ class SubscriptionChangePlanParams(TypedDict, total=False):
15
16
 
16
17
  quantity: Required[int]
17
18
  """Number of units to subscribe for. Must be at least 1."""
19
+
20
+ addons: Optional[Iterable[Addon]]
21
+ """
22
+ Addons for the new plan. Note : Leaving this empty would remove any existing
23
+ addons
24
+ """
25
+
26
+
27
+ class Addon(TypedDict, total=False):
28
+ addon_id: Required[str]
29
+
30
+ quantity: Required[int]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dodopayments
3
- Version: 1.20.0
3
+ Version: 1.22.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
@@ -59,7 +59,7 @@ import os
59
59
  from dodopayments import DodoPayments
60
60
 
61
61
  client = DodoPayments(
62
- api_key=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
62
+ bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
63
63
  # defaults to "live_mode".
64
64
  environment="test_mode",
65
65
  )
@@ -83,10 +83,10 @@ payment = client.payments.create(
83
83
  print(payment.payment_id)
84
84
  ```
85
85
 
86
- While you can provide an `api_key` keyword argument,
86
+ While you can provide a `bearer_token` keyword argument,
87
87
  we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
88
- to add `DODO_PAYMENTS_API_KEY="My API Key"` to your `.env` file
89
- so that your API Key is not stored in source control.
88
+ to add `DODO_PAYMENTS_API_KEY="My Bearer Token"` to your `.env` file
89
+ so that your Bearer Token is not stored in source control.
90
90
 
91
91
  ## Async usage
92
92
 
@@ -98,7 +98,7 @@ import asyncio
98
98
  from dodopayments import AsyncDodoPayments
99
99
 
100
100
  client = AsyncDodoPayments(
101
- api_key=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
101
+ bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
102
102
  # defaults to "live_mode".
103
103
  environment="test_mode",
104
104
  )
@@ -1,6 +1,6 @@
1
1
  dodopayments/__init__.py,sha256=DckFZUJVZhk7cGJAKZrWqBfut7BDpm64e3o-d2p_DsY,2550
2
2
  dodopayments/_base_client.py,sha256=L1uR4FGZPe2sXxx0nAXx3pGO7vH9BtQDEWWKJL2bGtQ,64850
3
- dodopayments/_client.py,sha256=tGXybGDOW7eaYh4hzgU4BMoRMaKSRMC9erKl-n-pJXM,26698
3
+ dodopayments/_client.py,sha256=C7ryh99xpBAUi_1MADl5LKgVOpb-bu8WjkaKBUEkfa0,26868
4
4
  dodopayments/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
5
  dodopayments/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
6
  dodopayments/_exceptions.py,sha256=NgI0bxilB8xXOfjBWCzr-Y7t1aIJGMqCQRXvSyy29cM,3232
@@ -11,12 +11,12 @@ dodopayments/_resource.py,sha256=Jfh17Q3kKzAhO-dlfIwYlueN9t1edaaY_vmnC9vErpA,113
11
11
  dodopayments/_response.py,sha256=PDvrSN3E3IkXVw2GvyOCTNB8ch0Xn9yaWQz4w1nHZEQ,28854
12
12
  dodopayments/_streaming.py,sha256=U4D6MhotaUaGaHz32lBt0XM98IOPIpPbKHUfbb0HGCk,10124
13
13
  dodopayments/_types.py,sha256=xr6JCSMzA-ItAyUrj6yw3GuC5rwQFVUo-Uiw9OTOWyo,6149
14
- dodopayments/_version.py,sha256=J92nLiz0KgTv6IPPfJa0DxDO5bLWzmhOZ9IcfHpmp_g,165
14
+ dodopayments/_version.py,sha256=R7b5ujYibIz6KweOYur_mubmbgu7oTUFhdZVzbsiUxY,165
15
15
  dodopayments/pagination.py,sha256=WYDrAWHvGL58Fe6X2yYZyYTAFvzWOR63JAsKURk2ti4,1308
16
16
  dodopayments/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  dodopayments/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
18
18
  dodopayments/_utils/_logs.py,sha256=wS-wfjlRVqO9Na43iwXZXBQ3Vm0dbZRPyOl9xYum580,793
19
- dodopayments/_utils/_proxy.py,sha256=z3zsateHtb0EARTWKk8QZNHfPkqJbqwd1lM993LBwGE,1902
19
+ dodopayments/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
20
20
  dodopayments/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
21
21
  dodopayments/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
22
22
  dodopayments/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
@@ -27,7 +27,7 @@ dodopayments/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
27
27
  dodopayments/resources/__init__.py,sha256=IxanDN3kaD2Z3odRKnb45ZSEQqKIxPBwB-UvVwi5W2I,7480
28
28
  dodopayments/resources/addons.py,sha256=7kzJrIcIgJfww20aovTrl0EIDslk17QSm0LfC9Cqd04,22058
29
29
  dodopayments/resources/discounts.py,sha256=vAh52lyiiuqSghTku1waNxUQISfIz0e2c79OIO8x_VY,24920
30
- dodopayments/resources/disputes.py,sha256=NjnIY5ulXc2WcawNppgkV6_aAgM7xXoBVixXLrOr-Bs,11783
30
+ dodopayments/resources/disputes.py,sha256=Ck3whmCMz0hPUwT6wPFZgFCcXhqewSyCrx0SH6AeN0Y,12027
31
31
  dodopayments/resources/license_key_instances.py,sha256=oCgJ-D6JVP_Fte_IjRHnykqhAynN6rDJphrkg6hyxjE,14082
32
32
  dodopayments/resources/license_keys.py,sha256=gKN2_CcpmMRj80BTQ45AG8RhaBtr-ZhXaPUdMZq-Wo4,15926
33
33
  dodopayments/resources/licenses.py,sha256=S7cNB9k82pJBiHfdRjmNdvEfDaYUGNUigLBJPgUyg-E,13150
@@ -35,18 +35,18 @@ dodopayments/resources/misc.py,sha256=BRPUna3lLIrJ-gMGOOQL1-xYx_oMwVDzKL4d498C7p
35
35
  dodopayments/resources/payments.py,sha256=-cHG8LIlbfepR2pk_ZcnM7QDhDgvyScTg7UtrXM67xI,20884
36
36
  dodopayments/resources/payouts.py,sha256=NjBQALlhMcbMDO5AdWLioSFrGdMvpqki_HydRl0XJyE,6995
37
37
  dodopayments/resources/refunds.py,sha256=efAmscUB09FuJgvELLira6zSXbV-h3IgRTugQ6baUDU,14734
38
- dodopayments/resources/subscriptions.py,sha256=9fDgzSDyJINzeY-kRXGnw3Y-8i_Q3Sz-PtxZtsOv25o,34948
38
+ dodopayments/resources/subscriptions.py,sha256=ZBD0b4wJ2wF6edbl7JwIZhRu6txg1X24H15_y97fk2M,35454
39
39
  dodopayments/resources/webhook_events.py,sha256=1OrWx7h4_Nb_yyl3ySCTz0QXM7LAYqVC2ipcveOvSdM,11726
40
40
  dodopayments/resources/customers/__init__.py,sha256=RIP1WYqO_PIq9b57tDaJWf9zIRxG_iFeFkOVhe3apAo,1146
41
41
  dodopayments/resources/customers/customer_portal.py,sha256=E967nei40PZfCRFDv5K0jxxVBEOFpmZsEIkseOGsUM0,7010
42
42
  dodopayments/resources/customers/customers.py,sha256=lfd11GpmGFSEMETRAMHP3M74LRK_ZqwX5BgAy8ProSo,18125
43
43
  dodopayments/resources/invoices/__init__.py,sha256=r81DwjI_F6B-ydnyJLSpowqPN0eTcROcPEvvzAkGPds,1054
44
44
  dodopayments/resources/invoices/invoices.py,sha256=-XZWHtZk92Wbbz5qO0DgiOCZGNKv4Slsd95feusnTnI,3761
45
- dodopayments/resources/invoices/payments.py,sha256=YE2u_N2cwLE6nY5M1QlHwGGmiiPD8XBiIgzQNMovPTc,5954
45
+ dodopayments/resources/invoices/payments.py,sha256=Kq32Cpzca3YuPdk8XjmF6wkRi6_BQ2aegyLf2FZ7KG8,6346
46
46
  dodopayments/resources/products/__init__.py,sha256=GKmDlI7Pw4UnnCRlnhb5WBh2Y3UYhqme7RqC35aztGo,1028
47
47
  dodopayments/resources/products/images.py,sha256=Dl-hxas2F6C30yhBifxCMy5xdLIgPSENHOhS8J6klJs,6388
48
48
  dodopayments/resources/products/products.py,sha256=ye95IBJpxWMUty8_y7w9C0mxY726OJCFIokp_qtn6rY,32277
49
- dodopayments/types/__init__.py,sha256=G5Nsh2PTdJXyj9GfYPBDjfoqBdjpfppgcJpWe0hztbw,5886
49
+ dodopayments/types/__init__.py,sha256=XwAOCZJcinZ2Bpmn-zSxyasOh5Kgr0LadadBjKJ0Ivs,6054
50
50
  dodopayments/types/addon_cart_response_item.py,sha256=R-I8Zd2HJKn0DmXmv6Oyu4oo-oEC1-dud0Q6_yqDB7k,235
51
51
  dodopayments/types/addon_create_params.py,sha256=TxMBkJG5ZJXdLiyAzJ8YJPzMg98nGn6stXYQ7I1sH-A,731
52
52
  dodopayments/types/addon_list_params.py,sha256=M3CxvfBwcirkJeNAIaOF2c5JdRR3GpTBVAZUdlfctg0,412
@@ -71,8 +71,10 @@ dodopayments/types/discount_create_params.py,sha256=6eGm-CdPKVUnYKqhs6QqE_GntT7K
71
71
  dodopayments/types/discount_list_params.py,sha256=o0Ui9uqFxJHw-lxFLZmttW9SmJWDmEwmKf9HT_RNxAc,422
72
72
  dodopayments/types/discount_type.py,sha256=2GOiaq6ssxLTFIMh_jO9mvFfoPhZp1XtUs516f6hrIM,213
73
73
  dodopayments/types/discount_update_params.py,sha256=XZpa1mBUC-jvRLwmMjshStWFsfeMSxIG893rSMQV0yY,1145
74
- dodopayments/types/dispute.py,sha256=YLER_3RMPHpaEzp8DaompGpbkOJu-U05yt1aVfyf5qw,937
74
+ dodopayments/types/dispute.py,sha256=GYc80xyoFj0jv4OMHmujCwdeMIiZjBIq7E6WG0vkQZ8,1018
75
75
  dodopayments/types/dispute_list_params.py,sha256=k5pngOisvEVni_UWq2wvBBtPXuMOcUV_Yz_zC8xTuUc,1075
76
+ dodopayments/types/dispute_list_response.py,sha256=gcHhBMDqxxmxu4Mj9G_aYOa9-SZJz7V-TvOCa_vYCqQ,961
77
+ dodopayments/types/dispute_retrieve_response.py,sha256=b4G877uw6NUWuN5wNYOCCV-DlCh_6MRMY18rizkWyDM,1216
76
78
  dodopayments/types/dispute_stage.py,sha256=OFaSeVXItONcrIoxGx37qccFVD_dvTeerPJ-d7pPwo8,244
77
79
  dodopayments/types/dispute_status.py,sha256=tBDzobNwCiCmlwT08Y8h3R-IuRPCn_M0IKEpQk-wPXA,363
78
80
  dodopayments/types/intent_status.py,sha256=0aP3OxHiMfZDXQFOOXNbTSZz1vZkLjBFm3ryT0sT4Z8,483
@@ -92,7 +94,7 @@ dodopayments/types/license_validate_response.py,sha256=vlSrdtsVYmQcsJpPMI-ENCf_a
92
94
  dodopayments/types/misc_list_supported_countries_response.py,sha256=Imr7f0CAjq04iikVbDSUvG1ZSYzB9Fopx8pVfVtt-zw,307
93
95
  dodopayments/types/one_time_product_cart_item.py,sha256=3l7J3KEE-SCXgArN25qKIXbIIu44Q2kxqd7jf73AGto,544
94
96
  dodopayments/types/one_time_product_cart_item_param.py,sha256=JydRYPBnLhON1pCQPRpQzKLaGJTSrDn1IRVCcMK8iAE,633
95
- dodopayments/types/payment.py,sha256=ULfCrKQgyUf9Ku0w3O7BVd36HdeSaoDp8bydc8V0M88,2732
97
+ dodopayments/types/payment.py,sha256=JgqPR4h2nMoVR1DKW7_Oago9IE8fV55OPcz_Y0zuoWc,3123
96
98
  dodopayments/types/payment_create_params.py,sha256=GlxEMIxXu7FzlMxltv2ZRyh70tnhsJdGXQIDWTKztwo,2395
97
99
  dodopayments/types/payment_create_response.py,sha256=6Evr_32yYRrMUnSTxD9QOLAgF-qAd8t85UGcLXI4BhE,1034
98
100
  dodopayments/types/payment_list_params.py,sha256=H1WGv-PKhLeBlBFXqenvrYNaviXYE-vBW94F_HLWkdU,1011
@@ -111,7 +113,7 @@ dodopayments/types/refund_create_params.py,sha256=vQsYzEerIKfHOKIxlTvYSEqcxdTNpX
111
113
  dodopayments/types/refund_list_params.py,sha256=oBgwuTJNhXpCOY0LKc-sItxPdOJUVYnS5KqcNqcXpgM,937
112
114
  dodopayments/types/refund_status.py,sha256=ftnBnLvslfMYcUg8t7nEvb6-m5NWyVVnNcgyVu9eZto,243
113
115
  dodopayments/types/subscription.py,sha256=8lcM-Yqn8uV2vpMABEEZPR3mT1bdCWgUTLyshuYn_B8,2238
114
- dodopayments/types/subscription_change_plan_params.py,sha256=QZXgpEqD1t6Orhbd9BANuL-ZWdIttq7l_oZtus4GReE,541
116
+ dodopayments/types/subscription_change_plan_params.py,sha256=eE_PKfkf-LwHL3H94EKxDzSpfH3NJOzH6OJez_glH60,831
115
117
  dodopayments/types/subscription_charge_params.py,sha256=IvO-k_cGQ8v5IO36F5ZEe4JJAhnkcBovjliMbZ4WN-U,467
116
118
  dodopayments/types/subscription_charge_response.py,sha256=aDFuOKqqQ-_v1szx9oUT89QaeM3nvwrlAExzZhF0O-Q,228
117
119
  dodopayments/types/subscription_create_params.py,sha256=vzr2_alFQKsbt5dzBLA_WWhOZdPBrf7faf8vsXxpbNE,3259
@@ -130,7 +132,7 @@ dodopayments/types/invoices/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekD
130
132
  dodopayments/types/products/__init__.py,sha256=-W2ETtkni8cZpsC4Eg1aRwuLg1plV1U429JFOR1U4Rw,273
131
133
  dodopayments/types/products/image_update_params.py,sha256=JmSZGjXI9uZgKdO9_7CINyIOmuphlmZr7-7P7kE-R5Q,308
132
134
  dodopayments/types/products/image_update_response.py,sha256=TcJyXjoJlONpwwR6yZdIuBTu2VNyLRZFELfstD9_V-o,273
133
- dodopayments-1.20.0.dist-info/METADATA,sha256=L2gkJ3_kz6uCIgEa8pMOF5OIJKR-_TDzLPvACdVRXpc,17380
134
- dodopayments-1.20.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
135
- dodopayments-1.20.0.dist-info/licenses/LICENSE,sha256=3_sqrBb5J3AT3FsjMKEOBRZhweWVsl_s_RjFlclm1vQ,11343
136
- dodopayments-1.20.0.dist-info/RECORD,,
135
+ dodopayments-1.22.0.dist-info/METADATA,sha256=MqjguFMAyL6TezayyhLbrjwl66Ct_lfA9dtviGcQA2s,17404
136
+ dodopayments-1.22.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
137
+ dodopayments-1.22.0.dist-info/licenses/LICENSE,sha256=3_sqrBb5J3AT3FsjMKEOBRZhweWVsl_s_RjFlclm1vQ,11343
138
+ dodopayments-1.22.0.dist-info/RECORD,,