From 41ada588885149e300b3d0e3d6689c0712c608fd Mon Sep 17 00:00:00 2001 From: David Grayston Date: Tue, 17 Dec 2024 19:20:41 +0000 Subject: [PATCH] fix: Adjustment type in responses is now the correct type --- CHANGELOG.md | 6 ++++++ paddle_billing/Client.py | 2 +- paddle_billing/Entities/Adjustment.py | 2 +- setup.py | 2 +- .../Resources/Adjustments/test_AdjustmentsClient.py | 3 +++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d958925..4b13a45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-python-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools. +## 1.3.1 - 2024-12-17 + +### Fixed + +- Adjustment type in responses is now the correct type + ## 1.3.0 - 2024-12-17 ### Added diff --git a/paddle_billing/Client.py b/paddle_billing/Client.py index 45059bf..04cf62b 100644 --- a/paddle_billing/Client.py +++ b/paddle_billing/Client.py @@ -204,7 +204,7 @@ def build_request_session(self) -> Session: "Authorization": f"Bearer {self.__api_key}", "Content-Type": "application/json", "Paddle-Version": str(self.use_api_version), - "User-Agent": "PaddleSDK/python 1.3.0", + "User-Agent": "PaddleSDK/python 1.3.1", } ) diff --git a/paddle_billing/Entities/Adjustment.py b/paddle_billing/Entities/Adjustment.py index f8b904b..f88c063 100644 --- a/paddle_billing/Entities/Adjustment.py +++ b/paddle_billing/Entities/Adjustment.py @@ -53,5 +53,5 @@ def from_dict(data: dict) -> Adjustment: ), updated_at=datetime.fromisoformat(data["updated_at"]) if data.get("updated_at") else None, tax_rates_used=[AdjustmentTaxRatesUsed.from_dict(item) for item in data["tax_rates_used"]], - type=AdjustmentStatus(data["type"]), + type=AdjustmentActionType(data["type"]), ) diff --git a/setup.py b/setup.py index 45f690a..d13c6b9 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( - version="1.3.0", + version="1.3.1", author="Paddle and contributors", author_email="team-dx@paddle.com", description="Paddle's Python SDK for Paddle Billing", diff --git a/tests/Functional/Resources/Adjustments/test_AdjustmentsClient.py b/tests/Functional/Resources/Adjustments/test_AdjustmentsClient.py index 9e82b51..a1a8580 100644 --- a/tests/Functional/Resources/Adjustments/test_AdjustmentsClient.py +++ b/tests/Functional/Resources/Adjustments/test_AdjustmentsClient.py @@ -177,6 +177,9 @@ def test_create_adjustment_returns_response_with_tax_rates_used( ) assert isinstance(response, Adjustment) + assert isinstance(response.action, Action) + assert isinstance(response.status, AdjustmentStatus) + assert isinstance(response.type, AdjustmentActionType) tax_rates_used = response.tax_rates_used[0] assert isinstance(tax_rates_used, AdjustmentTaxRatesUsed)