Skip to content

Commit

Permalink
fix: Adjustment type in responses is now the correct type
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgrayston-paddle committed Dec 17, 2024
1 parent 385c359 commit 41ada58
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion paddle_billing/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
)

Expand Down
2 changes: 1 addition & 1 deletion paddle_billing/Entities/Adjustment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


setup(
version="1.3.0",
version="1.3.1",
author="Paddle and contributors",
author_email="[email protected]",
description="Paddle's Python SDK for Paddle Billing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 41ada58

Please sign in to comment.