Closed wmp3 closed 4 months ago
Hello @wmp3, thank you for your interest in our work!
If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.
Indeed, the starts at is optional https://developer.paddle.com/api-reference/subscriptions/get-subscription
Fixed in: https://github.com/websideproject/paddle-billing-client/releases/tag/v0.2.10
š Bug Report
when
PaddleApiClient.get_subscription("sub_xxxx")
is called subscriptions has an associated Discount, Pydantic throws an error ifdiscount.starts_at
is None. I thinkstarts_at
could be None if for example customer uses a discount during trial but cancels before a paid subscription starts.Here's the error message I get:
š¬ How To Reproduce
Steps to reproduce the behavior:
I'm not exactly sure how to reproduce via PaddleApiClient but maybe something like:
Code sample
If the following small change doesn't break any tests, I think the bug can be fixed by changing https://github.com/websideproject/paddle-billing-client/blob/main/paddle_billing_client/models/subscription.py from:
to:
Environment
Screenshots
š Expected behavior
no pydantic validation error
š Additional context