Skip to content

Commit

Permalink
fix: Support null proration on transaction line items (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgrayston-paddle authored Nov 7, 2024
1 parent 99469f7 commit 2def986
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 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.

## 0.3.2 - 2024-11-07

### Fixed

- `paddle_billing.Entities.Shared.TransactionLineItemPreview` `proration` can now be None

## 0.3.1 - 2024-10-14

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion paddle_billing/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,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 0.2.2",
"User-Agent": "PaddleSDK/python 0.3.2",
}
)

Expand Down
4 changes: 2 additions & 2 deletions paddle_billing/Entities/Shared/TransactionLineItemPreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TransactionLineItemPreview:
unit_totals: UnitTotals
totals: Totals
product: Product
proration: Proration
proration: Proration | None

@staticmethod
def from_dict(data: dict) -> TransactionLineItemPreview:
Expand All @@ -26,5 +26,5 @@ def from_dict(data: dict) -> TransactionLineItemPreview:
unit_totals=UnitTotals.from_dict(data["unit_totals"]),
totals=Totals.from_dict(data["totals"]),
product=Product.from_dict(data["product"]),
proration=Proration.from_dict(data["proration"]),
proration=Proration.from_dict(data["proration"]) if data.get("proration") else None,
)
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="0.3.1",
version="0.3.2",
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 @@ -130,13 +130,7 @@
"discount": "3000",
"total": "27000"
},
"proration": {
"rate": "0",
"billing_period": {
"starts_at": "2023-08-21T11:31:08.689295Z",
"ends_at": "2023-09-21T11:31:08.689295Z"
}
}
"proration": null
},
{
"price_id": "pri_01gsz98e27ak2tyhexptwc58yk",
Expand Down Expand Up @@ -164,13 +158,6 @@
"tax": "0",
"discount": "1990",
"total": "17910"
},
"proration": {
"rate": "0",
"billing_period": {
"starts_at": "2023-08-21T11:31:08.689295Z",
"ends_at": "2023-09-21T11:31:08.689295Z"
}
}
}
]
Expand Down

0 comments on commit 2def986

Please sign in to comment.