dodopayments 1.56.2__py3-none-any.whl → 1.56.4__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.
@@ -57,9 +57,8 @@ class Stream(Generic[_T]):
57
57
  for sse in iterator:
58
58
  yield process_data(data=sse.json(), cast_to=cast_to, response=response)
59
59
 
60
- # Ensure the entire stream is consumed
61
- for _sse in iterator:
62
- ...
60
+ # As we might not fully consume the response stream, we need to close it explicitly
61
+ response.close()
63
62
 
64
63
  def __enter__(self) -> Self:
65
64
  return self
@@ -121,9 +120,8 @@ class AsyncStream(Generic[_T]):
121
120
  async for sse in iterator:
122
121
  yield process_data(data=sse.json(), cast_to=cast_to, response=response)
123
122
 
124
- # Ensure the entire stream is consumed
125
- async for _sse in iterator:
126
- ...
123
+ # As we might not fully consume the response stream, we need to close it explicitly
124
+ await response.aclose()
127
125
 
128
126
  async def __aenter__(self) -> Self:
129
127
  return self
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.56.2" # x-release-please-version
4
+ __version__ = "1.56.4" # x-release-please-version
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Union, Iterable, Optional
5
+ from typing import Dict, Union, Iterable, Optional
6
6
  from datetime import datetime
7
7
  from typing_extensions import Literal
8
8
 
@@ -52,6 +52,7 @@ class RefundsResource(SyncAPIResource):
52
52
  *,
53
53
  payment_id: str,
54
54
  items: Optional[Iterable[refund_create_params.Item]] | Omit = omit,
55
+ metadata: Dict[str, str] | Omit = omit,
55
56
  reason: Optional[str] | Omit = omit,
56
57
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
57
58
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -66,6 +67,8 @@ class RefundsResource(SyncAPIResource):
66
67
 
67
68
  items: Partially Refund an Individual Item
68
69
 
70
+ metadata: Additional metadata associated with the refund.
71
+
69
72
  reason: The reason for the refund, if any. Maximum length is 3000 characters. Optional.
70
73
 
71
74
  extra_headers: Send extra headers
@@ -82,6 +85,7 @@ class RefundsResource(SyncAPIResource):
82
85
  {
83
86
  "payment_id": payment_id,
84
87
  "items": items,
88
+ "metadata": metadata,
85
89
  "reason": reason,
86
90
  },
87
91
  refund_create_params.RefundCreateParams,
@@ -210,6 +214,7 @@ class AsyncRefundsResource(AsyncAPIResource):
210
214
  *,
211
215
  payment_id: str,
212
216
  items: Optional[Iterable[refund_create_params.Item]] | Omit = omit,
217
+ metadata: Dict[str, str] | Omit = omit,
213
218
  reason: Optional[str] | Omit = omit,
214
219
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
215
220
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -224,6 +229,8 @@ class AsyncRefundsResource(AsyncAPIResource):
224
229
 
225
230
  items: Partially Refund an Individual Item
226
231
 
232
+ metadata: Additional metadata associated with the refund.
233
+
227
234
  reason: The reason for the refund, if any. Maximum length is 3000 characters. Optional.
228
235
 
229
236
  extra_headers: Send extra headers
@@ -240,6 +247,7 @@ class AsyncRefundsResource(AsyncAPIResource):
240
247
  {
241
248
  "payment_id": payment_id,
242
249
  "items": items,
250
+ "metadata": metadata,
243
251
  "reason": reason,
244
252
  },
245
253
  refund_create_params.RefundCreateParams,
@@ -17,6 +17,7 @@ PaymentMethodTypes: TypeAlias = Literal[
17
17
  "eps",
18
18
  "ideal",
19
19
  "przelewy24",
20
+ "paypal",
20
21
  "affirm",
21
22
  "klarna",
22
23
  "sepa",
@@ -1,6 +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
+ from typing import Dict, Optional
4
4
  from datetime import datetime
5
5
 
6
6
  from .._models import BaseModel
@@ -24,6 +24,9 @@ class Refund(BaseModel):
24
24
  is_partial: bool
25
25
  """If true the refund is a partial refund"""
26
26
 
27
+ metadata: Dict[str, str]
28
+ """Additional metadata stored with the refund."""
29
+
27
30
  payment_id: str
28
31
  """The unique identifier of the payment associated with the refund."""
29
32
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Iterable, Optional
5
+ from typing import Dict, Iterable, Optional
6
6
  from typing_extensions import Required, TypedDict
7
7
 
8
8
  __all__ = ["RefundCreateParams", "Item"]
@@ -15,6 +15,9 @@ class RefundCreateParams(TypedDict, total=False):
15
15
  items: Optional[Iterable[Item]]
16
16
  """Partially Refund an Individual Item"""
17
17
 
18
+ metadata: Dict[str, str]
19
+ """Additional metadata associated with the refund."""
20
+
18
21
  reason: Optional[str]
19
22
  """The reason for the refund, if any. Maximum length is 3000 characters. Optional."""
20
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dodopayments
3
- Version: 1.56.2
3
+ Version: 1.56.4
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
@@ -9,9 +9,9 @@ dodopayments/_models.py,sha256=lKnskYPONAWDvWo8tmbbVk7HmG7UOsI0Nve0vSMmkRc,30452
9
9
  dodopayments/_qs.py,sha256=craIKyvPktJ94cvf9zn8j8ekG9dWJzhWv0ob34lIOv4,4828
10
10
  dodopayments/_resource.py,sha256=Jfh17Q3kKzAhO-dlfIwYlueN9t1edaaY_vmnC9vErpA,1136
11
11
  dodopayments/_response.py,sha256=PDvrSN3E3IkXVw2GvyOCTNB8ch0Xn9yaWQz4w1nHZEQ,28854
12
- dodopayments/_streaming.py,sha256=U4D6MhotaUaGaHz32lBt0XM98IOPIpPbKHUfbb0HGCk,10124
12
+ dodopayments/_streaming.py,sha256=pwC7nSxRVHGK87t9qFuOg2ecKuq3fStA6EbORozeeIY,10173
13
13
  dodopayments/_types.py,sha256=CuN9iBczmyAIb_jqVBZ5gauyxAv6ya6d7w0Xj39EJcs,7242
14
- dodopayments/_version.py,sha256=VMwQru0ye53aclZirwfng5ODJk7vSmws4jsXEpOy34Q,165
14
+ dodopayments/_version.py,sha256=5m_6q5wlkfO1AR9LEzWdp9zr8EblOh7fBxLkurvXjUI,165
15
15
  dodopayments/pagination.py,sha256=gaS62u_b_92OYnUHmstLAFL5AF2_cr3Z6VpzSHd0mMw,2796
16
16
  dodopayments/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  dodopayments/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
@@ -40,7 +40,7 @@ dodopayments/resources/meters.py,sha256=rw-XSHRXdMScANLNKFCLXTh4EBP-5fX4acYsAlc7
40
40
  dodopayments/resources/misc.py,sha256=PIp_ZkbbtaOEA5Q_Wda4Cngv7HG4p6Kkdg7MDD2dw6c,5081
41
41
  dodopayments/resources/payments.py,sha256=9IZKqgdN0lpRJ4iBT0GUcrBLGpfnHIsXz9jRMVRQUv0,24601
42
42
  dodopayments/resources/payouts.py,sha256=gn8Vx0ALnJW14tRWV__FFoWLkU3lWKDd4of5SIUNVE4,7732
43
- dodopayments/resources/refunds.py,sha256=vssQ990GZaBZb6-jSxjXEWcdj03nf2mNdNVxkd6xhsU,15057
43
+ dodopayments/resources/refunds.py,sha256=O9hHIoopoK0jqahpFnqwqAXbmAuzbuJaSDhR0BNBjMw,15381
44
44
  dodopayments/resources/subscriptions.py,sha256=cCg-GKZfEH2P8rVBV2cYl9gs17rnt7hGPovyveFtBkY,49344
45
45
  dodopayments/resources/usage_events.py,sha256=yPLaWJL6_7PmK1K9as_TxVFzwj44ZRS3Wd6kaldSGoU,22197
46
46
  dodopayments/resources/customers/__init__.py,sha256=LCE-I9hVmlMoL9NbPUp1fbmv-mvpkbJtkJJY9TW4t28,1609
@@ -153,7 +153,7 @@ dodopayments/types/payment_failed_webhook_event.py,sha256=HkcE-U4XiBg94syLmq7LiQ
153
153
  dodopayments/types/payment_failed_webhook_event1.py,sha256=HkcE-U4XiBg94syLmq7LiQmJbMRXgnfvXd5vkw9x7ME,704
154
154
  dodopayments/types/payment_list_params.py,sha256=CH6z3MqKkQsoWzuSnsxxEj60HBrAsUKwQ_9iLm4uZJc,1283
155
155
  dodopayments/types/payment_list_response.py,sha256=I4X52FokitP_OzrR7qQSnIrswyIDOI8E1gu1h4vyDHA,784
156
- dodopayments/types/payment_method_types.py,sha256=_Kp6SGsquALvZ7WRboxDsTdFhJxtgQtlpOmBtp-bMfM,505
156
+ dodopayments/types/payment_method_types.py,sha256=Ms0ftDnFdEkBh4O0c3UNd_Be9v5ZtG8Hb9uy_R0cjfs,519
157
157
  dodopayments/types/payment_processing_webhook_event.py,sha256=PZs1cabaMK-S7DfRP-FQl4khG8F_kiwbBYf-WmJGQVE,716
158
158
  dodopayments/types/payment_processing_webhook_event1.py,sha256=PZs1cabaMK-S7DfRP-FQl4khG8F_kiwbBYf-WmJGQVE,716
159
159
  dodopayments/types/payment_retrieve_line_items_response.py,sha256=Cxfq-BNHw0AyoLzZ6-5JAcQLkHsKWHg0e0a3yBfzRXU,513
@@ -170,8 +170,8 @@ dodopayments/types/product_list_response.py,sha256=quSCR3qak0T1aLPsZSgnkRGLSwFEW
170
170
  dodopayments/types/product_update_files_params.py,sha256=7AkcQ3mWfc2WyUOnWabzst-gQaWTuS3KSvmM1KYnhT4,300
171
171
  dodopayments/types/product_update_files_response.py,sha256=a6sNHOCHQxxA7l55M3zS8S26O3UEFo1vctngHIy5tJo,239
172
172
  dodopayments/types/product_update_params.py,sha256=WuvH5Dd_cZgJ2n_lXOh1XzCBuQdq9N1Kl45U_IT6Lq8,2576
173
- dodopayments/types/refund.py,sha256=dp50pvFEU89ETZsQLA9ntDGsi-0jc5M-qbb_t9cFOEs,1246
174
- dodopayments/types/refund_create_params.py,sha256=hua-rUlW_5ZfKaPsh8O06yPgsj0gH7ru9Rw0Rb-3moQ,912
173
+ dodopayments/types/refund.py,sha256=HfR9clJ17WYAj97IpalDmY-gs9_OLlV6PY2qMINlD6w,1336
174
+ dodopayments/types/refund_create_params.py,sha256=gPt2uxRQyS4qMzlqQzOP6t1AgFapM7zj4M0oMerrHhE,1006
175
175
  dodopayments/types/refund_failed_webhook_event.py,sha256=Qnq8RlvyOWDkLQWs08gREQWFOTYvIioIY7H04nRHLfE,697
176
176
  dodopayments/types/refund_failed_webhook_event1.py,sha256=Qnq8RlvyOWDkLQWs08gREQWFOTYvIioIY7H04nRHLfE,697
177
177
  dodopayments/types/refund_list_params.py,sha256=iz4MPgquP4K3AlYPV5_bbt5jHzGFT__RTpGjT4QXnPs,883
@@ -233,7 +233,7 @@ dodopayments/types/products/image_update_response.py,sha256=TcJyXjoJlONpwwR6yZdI
233
233
  dodopayments/types/webhooks/__init__.py,sha256=F_ZpQalnBiuXt_C2pUepZjgJZwiAGKNwaEB03ZB6sUM,285
234
234
  dodopayments/types/webhooks/header_retrieve_response.py,sha256=IKNaI2xO9qU7UXbffENYrRo2vUr0mqb8TIkAQdtLtXI,369
235
235
  dodopayments/types/webhooks/header_update_params.py,sha256=USiXP4oFllTJgOBcBZQrcLlEzEOB6RHH9Ugdxatyy3g,376
236
- dodopayments-1.56.2.dist-info/METADATA,sha256=lpFF7_SHHTi36yB2WBB32lMiUPQ0S7LLAgI5EzYgUe4,17302
237
- dodopayments-1.56.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
238
- dodopayments-1.56.2.dist-info/licenses/LICENSE,sha256=3_sqrBb5J3AT3FsjMKEOBRZhweWVsl_s_RjFlclm1vQ,11343
239
- dodopayments-1.56.2.dist-info/RECORD,,
236
+ dodopayments-1.56.4.dist-info/METADATA,sha256=1E6VoGIqtcavINc0jBlGOpSD-1gsGfgO5bMPcG6gN_k,17302
237
+ dodopayments-1.56.4.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
238
+ dodopayments-1.56.4.dist-info/licenses/LICENSE,sha256=3_sqrBb5J3AT3FsjMKEOBRZhweWVsl_s_RjFlclm1vQ,11343
239
+ dodopayments-1.56.4.dist-info/RECORD,,