websideproject / paddle-billing-client

Python wrapper around the new Paddle Billing API
MIT License
14 stars 6 forks source link

Error in webhooks when creating a new Discount in paddle #410

Closed bndr closed 2 months ago

bndr commented 2 months ago

🐛 Bug Report

ValidationError 1 validation error for Discount times_used Field required [type=missing, input_value={'id': 'dsc_0xxxx...recurring_intervals': 3}, input_type=dict] For further information visit https://errors.pydantic.dev/2.8/v/missing

🔬 How To Reproduce

Steps to reproduce the behavior:

  1. Create a discount
  2. Wait for the webhook to sync discounts
  3. times_used is marked as missing
  4. I would expect that not to be an issue for a freshly created discount
error_123
github-actions[bot] commented 2 months ago

Hello @bndr, 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.

bgervan commented 2 months ago

https://developer.paddle.com/api-reference/discounts/overview

image

The times_used is not optional based on their doc, they should return 0. Which event type was it?

bndr commented 2 months ago

The event was discount.created. Attaching the screenshot from Sentry with the raw payload received.

ValidationError: 1 validation error for Discount times_used Field required  type=missing, input_value={'id': 'dsc_01j4hdyshf3e2… 2024-08-06 14-12-31
bgervan commented 2 months ago

This is a bug in their doc or in their system, but I made the required change.

Released with v0.2.12

Let me know if it solved your issue. You may need to specify the new version if you installed the paddle billing client through the django package, will update the deps there too

bndr commented 2 months ago

Thanks a lot. Appreciate the changes, I do use the Django package, and I just pull the repo directly, not through PyPi.