Skip to content

Commit b62008b

Browse files
feat: Add support for adjustment type and VND currency
1 parent d4e881a commit b62008b

File tree

19 files changed

+190
-5
lines changed

19 files changed

+190
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ 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.0 - 2024-12-17
10+
11+
### Added
12+
13+
- Support for adjustment type, see [related changelog](https://developer.paddle.com/changelog/2024/refund-credit-full-total?utm_source=dx&utm_medium=paddle-python-sdk)
14+
- Added Vietnamese Dong (`VND`) as a supported currency for payments [related changelog](https://developer.paddle.com/changelog/2024/vietnamese-dong-vnd-supported-currency?utm_source=dx&utm_medium=paddle-python-sdk)
15+
916
## 1.2.1 - 2024-12-04
1017

1118
### Fixed

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.2.1",
207+
"User-Agent": "PaddleSDK/python 1.3.0",
208208
}
209209
)
210210

paddle_billing/Entities/Adjustment.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from paddle_billing.Entities.Adjustments import AdjustmentItem, AdjustmentTaxRatesUsed
77
from paddle_billing.Entities.Shared import (
88
Action,
9+
AdjustmentActionType,
910
AdjustmentStatus,
1011
CurrencyCode,
1112
PayoutTotalsAdjustment,
@@ -30,6 +31,7 @@ class Adjustment(Entity):
3031
created_at: datetime
3132
updated_at: datetime | None
3233
tax_rates_used: list[AdjustmentTaxRatesUsed]
34+
type: AdjustmentActionType
3335

3436
@staticmethod
3537
def from_dict(data: dict) -> Adjustment:
@@ -51,4 +53,5 @@ def from_dict(data: dict) -> Adjustment:
5153
),
5254
updated_at=datetime.fromisoformat(data["updated_at"]) if data.get("updated_at") else None,
5355
tax_rates_used=[AdjustmentTaxRatesUsed.from_dict(item) for item in data["tax_rates_used"]],
56+
type=AdjustmentStatus(data["type"]),
5457
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta
2+
3+
4+
class AdjustmentActionType(PaddleStrEnum, metaclass=PaddleStrEnumMeta):
5+
Full: "AdjustmentActionType" = "full"
6+
Partial: "AdjustmentActionType" = "partial"

paddle_billing/Entities/Shared/CurrencyCode.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ class CurrencyCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta):
3131
TRY: "CurrencyCode" = "TRY"
3232
TWD: "CurrencyCode" = "TWD"
3333
UAH: "CurrencyCode" = "UAH"
34+
VND: "CurrencyCode" = "VND"
3435
ZAR: "CurrencyCode" = "ZAR"

paddle_billing/Entities/Shared/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from paddle_billing.Entities.Shared.Action import Action
22
from paddle_billing.Entities.Shared.AddressPreview import AddressPreview
3+
from paddle_billing.Entities.Shared.AdjustmentActionType import AdjustmentActionType
34
from paddle_billing.Entities.Shared.AdjustmentItemTotals import AdjustmentItemTotals
45
from paddle_billing.Entities.Shared.AdjustmentStatus import AdjustmentStatus
56
from paddle_billing.Entities.Shared.AdjustmentTotals import AdjustmentTotals

paddle_billing/Notifications/Entities/Adjustment.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from paddle_billing.Notifications.Entities.Entity import Entity
77
from paddle_billing.Notifications.Entities.Shared import (
88
Action,
9+
AdjustmentActionType,
910
AdjustmentStatus,
1011
CurrencyCode,
1112
PayoutTotalsAdjustment,
@@ -30,6 +31,7 @@ class Adjustment(Entity):
3031
created_at: datetime
3132
updated_at: datetime | None
3233
tax_rates_used: list[AdjustmentTaxRatesUsed] | None
34+
type: AdjustmentActionType | None
3335

3436
@staticmethod
3537
def from_dict(data: dict) -> Adjustment:
@@ -55,4 +57,5 @@ def from_dict(data: dict) -> Adjustment:
5557
if data.get("tax_rates_used")
5658
else None
5759
),
60+
type=AdjustmentActionType(data["type"]) if data.get("type") else None,
5861
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from paddle_billing.PaddleStrEnum import PaddleStrEnum, PaddleStrEnumMeta
2+
3+
4+
class AdjustmentActionType(PaddleStrEnum, metaclass=PaddleStrEnumMeta):
5+
Full: "AdjustmentActionType" = "full"
6+
Partial: "AdjustmentActionType" = "partial"

paddle_billing/Notifications/Entities/Shared/CurrencyCode.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ class CurrencyCode(PaddleStrEnum, metaclass=PaddleStrEnumMeta):
3131
TRY: "CurrencyCode" = "TRY"
3232
TWD: "CurrencyCode" = "TWD"
3333
UAH: "CurrencyCode" = "UAH"
34+
VND: "CurrencyCode" = "VND"
3435
ZAR: "CurrencyCode" = "ZAR"

paddle_billing/Notifications/Entities/Shared/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from paddle_billing.Notifications.Entities.Shared.Action import Action
22
from paddle_billing.Notifications.Entities.Shared.AddressPreview import AddressPreview
3+
from paddle_billing.Notifications.Entities.Shared.AdjustmentActionType import AdjustmentActionType
34
from paddle_billing.Notifications.Entities.Shared.AdjustmentItemTotals import AdjustmentItemTotals
45
from paddle_billing.Notifications.Entities.Shared.AdjustmentStatus import AdjustmentStatus
56
from paddle_billing.Notifications.Entities.Shared.AdjustmentTotals import AdjustmentTotals

0 commit comments

Comments
 (0)