Skip to content

Commit 5cbf524

Browse files
fix: Adjustment type in responses is now the correct type (#84)
1 parent 385c359 commit 5cbf524

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
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.
88

9+
## 1.3.1 - 2024-12-17
10+
11+
### Fixed
12+
13+
- Adjustment type in responses is now the correct type
14+
915
## 1.3.0 - 2024-12-17
1016

1117
### Added

paddle_billing/Client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def build_request_session(self) -> Session:
204204
"Authorization": f"Bearer {self.__api_key}",
205205
"Content-Type": "application/json",
206206
"Paddle-Version": str(self.use_api_version),
207-
"User-Agent": "PaddleSDK/python 1.3.0",
207+
"User-Agent": "PaddleSDK/python 1.3.1",
208208
}
209209
)
210210

paddle_billing/Entities/Adjustment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ def from_dict(data: dict) -> Adjustment:
5353
),
5454
updated_at=datetime.fromisoformat(data["updated_at"]) if data.get("updated_at") else None,
5555
tax_rates_used=[AdjustmentTaxRatesUsed.from_dict(item) for item in data["tax_rates_used"]],
56-
type=AdjustmentStatus(data["type"]),
56+
type=AdjustmentActionType(data["type"]),
5757
)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
setup(
5-
version="1.3.0",
5+
version="1.3.1",
66
author="Paddle and contributors",
77
author_email="team-dx@paddle.com",
88
description="Paddle's Python SDK for Paddle Billing",

tests/Functional/Resources/Adjustments/test_AdjustmentsClient.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ def test_create_adjustment_returns_response_with_tax_rates_used(
177177
)
178178

179179
assert isinstance(response, Adjustment)
180+
assert isinstance(response.action, Action)
181+
assert isinstance(response.status, AdjustmentStatus)
182+
assert isinstance(response.type, AdjustmentActionType)
180183

181184
tax_rates_used = response.tax_rates_used[0]
182185
assert isinstance(tax_rates_used, AdjustmentTaxRatesUsed)

0 commit comments

Comments
 (0)