paddle-python-sdk 1.2.1__py3-none-any.whl → 1.2.2__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.
- paddle_billing/Client.py +1 -1
- paddle_billing/Entities/Subscriptions/SubscriptionDiscount.py +3 -3
- paddle_billing/Notifications/Entities/Subscriptions/SubscriptionDiscount.py +3 -3
- {paddle_python_sdk-1.2.1.dist-info → paddle_python_sdk-1.2.2.dist-info}/METADATA +1 -1
- {paddle_python_sdk-1.2.1.dist-info → paddle_python_sdk-1.2.2.dist-info}/RECORD +9 -9
- tests/Functional/Resources/Subscriptions/test_SubscriptionsClient.py +21 -0
- {paddle_python_sdk-1.2.1.dist-info → paddle_python_sdk-1.2.2.dist-info}/LICENSE +0 -0
- {paddle_python_sdk-1.2.1.dist-info → paddle_python_sdk-1.2.2.dist-info}/WHEEL +0 -0
- {paddle_python_sdk-1.2.1.dist-info → paddle_python_sdk-1.2.2.dist-info}/top_level.txt +0 -0
paddle_billing/Client.py
CHANGED
|
@@ -204,7 +204,7 @@ class Client:
|
|
|
204
204
|
"Authorization": f"Bearer {self.__api_key}",
|
|
205
205
|
"Content-Type": "application/json",
|
|
206
206
|
"Paddle-Version": str(self.use_api_version),
|
|
207
|
-
"User-Agent": "PaddleSDK/python 1.2.
|
|
207
|
+
"User-Agent": "PaddleSDK/python 1.2.2",
|
|
208
208
|
}
|
|
209
209
|
)
|
|
210
210
|
|
|
@@ -6,13 +6,13 @@ from datetime import datetime
|
|
|
6
6
|
@dataclass
|
|
7
7
|
class SubscriptionDiscount:
|
|
8
8
|
id: str
|
|
9
|
-
starts_at: datetime
|
|
10
|
-
ends_at: datetime
|
|
9
|
+
starts_at: datetime | None
|
|
10
|
+
ends_at: datetime | None
|
|
11
11
|
|
|
12
12
|
@staticmethod
|
|
13
13
|
def from_dict(data: dict) -> SubscriptionDiscount:
|
|
14
14
|
return SubscriptionDiscount(
|
|
15
15
|
id=data["id"],
|
|
16
|
-
starts_at=datetime.fromisoformat(data["starts_at"]),
|
|
16
|
+
starts_at=datetime.fromisoformat(data["starts_at"]) if data.get("starts_at") else None,
|
|
17
17
|
ends_at=datetime.fromisoformat(data["ends_at"]) if data.get("ends_at") else None,
|
|
18
18
|
)
|
|
@@ -6,13 +6,13 @@ from datetime import datetime
|
|
|
6
6
|
@dataclass
|
|
7
7
|
class SubscriptionDiscount:
|
|
8
8
|
id: str
|
|
9
|
-
starts_at: datetime
|
|
10
|
-
ends_at: datetime
|
|
9
|
+
starts_at: datetime | None
|
|
10
|
+
ends_at: datetime | None
|
|
11
11
|
|
|
12
12
|
@staticmethod
|
|
13
13
|
def from_dict(data: dict) -> SubscriptionDiscount:
|
|
14
14
|
return SubscriptionDiscount(
|
|
15
15
|
id=data["id"],
|
|
16
|
-
starts_at=datetime.fromisoformat(data["starts_at"]),
|
|
16
|
+
starts_at=datetime.fromisoformat(data["starts_at"]) if data.get("starts_at") else None,
|
|
17
17
|
ends_at=datetime.fromisoformat(data["ends_at"]) if data.get("ends_at") else None,
|
|
18
18
|
)
|
|
@@ -4,7 +4,7 @@ examples/event_polling.py,sha256=580dg_8CFrSCA89Mr1ny4V1gtB3-hk-LfePTbI7DT5w,217
|
|
|
4
4
|
examples/get_products.py,sha256=4V7ZG1SH6Oxojufbtzm_TMySw4cOBMQ99mgQK_hlwFQ,1875
|
|
5
5
|
examples/logger.py,sha256=AxmQmMrsM0ZqMIUnh6iARiczL4S4F9OqQcOu-67owNg,1042
|
|
6
6
|
examples/webhook_verification.py,sha256=qkNscNdNZUAgxEIk83tCiljN2VmfePZ_k8zTliKz2QY,1205
|
|
7
|
-
paddle_billing/Client.py,sha256=
|
|
7
|
+
paddle_billing/Client.py,sha256=cxkmBfaCq8-I3SgeszfWEWBjO65MQogWrno0fP4dn_A,8787
|
|
8
8
|
paddle_billing/EnumStringify.py,sha256=iDvKULZat3jx9A-_PhvoN6CbFGf2pyxrQeYZxqX9n8M,48
|
|
9
9
|
paddle_billing/Environment.py,sha256=sY4nrJUwlTugsZKncieAnvfCojqCcKWi4X7rFzjFeSQ,417
|
|
10
10
|
paddle_billing/FiltersNone.py,sha256=HxjE6RJb7sy6txphpZSrCTQZt1Ua0XpIz8NDLHC43zo,268
|
|
@@ -170,7 +170,7 @@ paddle_billing/Entities/Subscriptions/SubscriptionAdjustmentItem.py,sha256=a0QNB
|
|
|
170
170
|
paddle_billing/Entities/Subscriptions/SubscriptionAdjustmentPreview.py,sha256=vd1fXc9X0IecddOkMxNivHgU0C2-2cGV37iVqotrcds,725
|
|
171
171
|
paddle_billing/Entities/Subscriptions/SubscriptionCharge.py,sha256=toASyrKTGeZ7X0ppmjinFGO5MeaeZWINEK8vyerzDDo,428
|
|
172
172
|
paddle_billing/Entities/Subscriptions/SubscriptionCredit.py,sha256=ahrlS0k4yqJd5zeZUrD_nuchnRleIE0xE_WUoKaZ4Zg,428
|
|
173
|
-
paddle_billing/Entities/Subscriptions/SubscriptionDiscount.py,sha256=
|
|
173
|
+
paddle_billing/Entities/Subscriptions/SubscriptionDiscount.py,sha256=Wb7leFA5DoWgUdPmGqFyXzSeX-NSAzeuRJ4nwG5qaQc,554
|
|
174
174
|
paddle_billing/Entities/Subscriptions/SubscriptionEffectiveFrom.py,sha256=YNu4jUYx9TZfb-s3uQeBMGRwwlJaW46j1aW1v94QlvI,289
|
|
175
175
|
paddle_billing/Entities/Subscriptions/SubscriptionItem.py,sha256=y9wC5Z9oPdetfrHZtXGV0qewDUSuDQ7QodB9DI6SwFA,1549
|
|
176
176
|
paddle_billing/Entities/Subscriptions/SubscriptionItemStatus.py,sha256=vzrvLhi_g_SQXvQgSSQcMPziKE9eTQpPX6Wj7Xo-RkE,302
|
|
@@ -307,7 +307,7 @@ paddle_billing/Notifications/Entities/Shared/__init__.py,sha256=UvruDr0XkWMEt05B
|
|
|
307
307
|
paddle_billing/Notifications/Entities/Subscriptions/SubscriptionAdjustmentItem.py,sha256=aED3Eq_OIWuR9RynjvVxa6LhuF6yYDfdpmRB9kiXbTg,730
|
|
308
308
|
paddle_billing/Notifications/Entities/Subscriptions/SubscriptionCharge.py,sha256=RZ9TkL9UckSUJ8stglrI_Ri71sy_-AZmbsTx2790sXQ,442
|
|
309
309
|
paddle_billing/Notifications/Entities/Subscriptions/SubscriptionCredit.py,sha256=v1R271DEZz8emuvxlpTPpNNR68Ye9OgFjoGSczQSs-0,442
|
|
310
|
-
paddle_billing/Notifications/Entities/Subscriptions/SubscriptionDiscount.py,sha256=
|
|
310
|
+
paddle_billing/Notifications/Entities/Subscriptions/SubscriptionDiscount.py,sha256=Wb7leFA5DoWgUdPmGqFyXzSeX-NSAzeuRJ4nwG5qaQc,554
|
|
311
311
|
paddle_billing/Notifications/Entities/Subscriptions/SubscriptionEffectiveFrom.py,sha256=YNu4jUYx9TZfb-s3uQeBMGRwwlJaW46j1aW1v94QlvI,289
|
|
312
312
|
paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItem.py,sha256=B-lUpjsNNASRTdQIEZc6Q0aqgxI5yq6luJ2ceF-boVQ,1707
|
|
313
313
|
paddle_billing/Notifications/Entities/Subscriptions/SubscriptionItemStatus.py,sha256=vzrvLhi_g_SQXvQgSSQcMPziKE9eTQpPX6Wj7Xo-RkE,302
|
|
@@ -578,7 +578,7 @@ tests/Functional/Resources/Products/test_ProductsClient.py,sha256=FlYIjv09RM4rJt
|
|
|
578
578
|
tests/Functional/Resources/Reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
579
579
|
tests/Functional/Resources/Reports/test_ReportsClient.py,sha256=jIOHBQ3YSw0rXrOKxlhIUGtqptUZMBWsMJHBwlhjOxg,13438
|
|
580
580
|
tests/Functional/Resources/Subscriptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
581
|
-
tests/Functional/Resources/Subscriptions/test_SubscriptionsClient.py,sha256=
|
|
581
|
+
tests/Functional/Resources/Subscriptions/test_SubscriptionsClient.py,sha256=9TW7z378xzu-JBTuPkOGY_CThzwQC7P97XYl-PK48bg,61719
|
|
582
582
|
tests/Functional/Resources/Transactions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
583
583
|
tests/Functional/Resources/Transactions/test_TransactionsClient.py,sha256=K3t47sr-HdqPosSXsERsjIGKhbxuWvP2pAdvBD_vLt4,59187
|
|
584
584
|
tests/Unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -593,8 +593,8 @@ tests/Utils/ReadsFixture.py,sha256=M3Ot3xHXp_C7vwttna9deLPHBAO8ml2Jb4thhHOJJ38,1
|
|
|
593
593
|
tests/Utils/TestClient.py,sha256=-wc7hJMuR6WC-ukw0c7I59b5-8hj_-nzq__-2M81elg,1453
|
|
594
594
|
tests/Utils/TestLogger.py,sha256=pFO9x711buRmg-8DAqpzIJP_hr21JPty1_ZQRcwoGKk,554
|
|
595
595
|
tests/Utils/__init__.py,sha256=JtqJNPKqbNZ9exlpXlF3yj_9cfylPGlvopjQYi7yYTA,37
|
|
596
|
-
paddle_python_sdk-1.2.
|
|
597
|
-
paddle_python_sdk-1.2.
|
|
598
|
-
paddle_python_sdk-1.2.
|
|
599
|
-
paddle_python_sdk-1.2.
|
|
600
|
-
paddle_python_sdk-1.2.
|
|
596
|
+
paddle_python_sdk-1.2.2.dist-info/LICENSE,sha256=e5Sn9mzCdpjnqCLxXpGHNKdYB6JlRSTLhN_CD4WSO6w,10770
|
|
597
|
+
paddle_python_sdk-1.2.2.dist-info/METADATA,sha256=0SKd4ERW64ijPyBiKdgxrguG1zP-lvlVD_hpCPjYqgo,7376
|
|
598
|
+
paddle_python_sdk-1.2.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
599
|
+
paddle_python_sdk-1.2.2.dist-info/top_level.txt,sha256=9a07VPng7o5wK8VAXkl6NC30xrNbW9zff_02jHyHi4c,30
|
|
600
|
+
paddle_python_sdk-1.2.2.dist-info/RECORD,,
|
|
@@ -371,6 +371,27 @@ class TestSubscriptionsClient:
|
|
|
371
371
|
str(expected_response_body)
|
|
372
372
|
), "The response JSON generated by ResponseParser() doesn't match the expected fixture JSON"
|
|
373
373
|
|
|
374
|
+
def test_list_subscriptions_supports_null_discount_starts_at(
|
|
375
|
+
self,
|
|
376
|
+
test_client,
|
|
377
|
+
mock_requests,
|
|
378
|
+
):
|
|
379
|
+
mock_requests.get(
|
|
380
|
+
f"{test_client.base_url}/subscriptions",
|
|
381
|
+
status_code=200,
|
|
382
|
+
text=ReadsFixtures.read_raw_json_fixture("response/list_default"),
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
response = test_client.client.subscriptions.list(ListSubscriptions())
|
|
386
|
+
|
|
387
|
+
assert isinstance(response, SubscriptionCollection)
|
|
388
|
+
assert response.items[0].discount is None
|
|
389
|
+
assert response.items[1].discount is None
|
|
390
|
+
assert response.items[2].discount.starts_at is None
|
|
391
|
+
assert response.items[2].discount.ends_at is None
|
|
392
|
+
assert response.items[3].discount.starts_at.isoformat() == "2024-04-12T10:18:47.635628+00:00"
|
|
393
|
+
assert response.items[3].discount.ends_at.isoformat() == "2024-05-12T10:18:47.635628+00:00"
|
|
394
|
+
|
|
374
395
|
@mark.parametrize(
|
|
375
396
|
"subscription_id, includes, expected_response_status, expected_response_body, expected_url",
|
|
376
397
|
[
|
|
File without changes
|
|
File without changes
|
|
File without changes
|