Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ pydantic==2.13.4
lxml==6.1.3
latex2mathml==3.78.1
markdown-it-py==4.0.0
stripe>=5.0.0,<6.0.0
stripe>=16.0.0,<17.0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocking: On stripe ≥15, stripe_webhook rejects every real event. subscription.py:279 passes the event's data object to a DRF serializer. On 15+ that object is no longer a dict. A probe with 16.0.0 and DRF 3.15.1 on stripe.Event.construct_from(...) gave this result:

valid: False {'non_field_errors': [... 'Invalid data. Expected a dictionary, but got Subscription.']}

The same probe passes on 5.5.0. The view logs a warning and returns 200. Stripe therefore doesn't retry. Paid checkouts never grant storage. Cancellations never revoke it.

The upgrade PR needs these changes:

  • Pass event["data"]["object"].to_dict() to the serializer.
  • Build the test events in tests/views/test_subscription.py with stripe.Event.construct_from(...) so that they fail without the fix.

django-pgtrigger<4.12.0 # 4.12 drops Django 3.2 support
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ djangorestframework==3.15.1
# via -r requirements.in
exceptiongroup==1.3.1
# via celery
google-api-core[grpc]==2.30.0
google-api-core==2.30.0
# via
# google-cloud-appengine-logging
# google-cloud-core
Expand Down Expand Up @@ -137,7 +137,7 @@ google-crc32c==1.8.0
# google-resumable-media
google-resumable-media==2.8.0
# via google-cloud-storage
googleapis-common-protos[grpc]==1.57.0
googleapis-common-protos==1.57.0
# via
# google-api-core
# google-cloud-audit-log
Expand Down Expand Up @@ -276,7 +276,7 @@ six==1.16.0
# python-dateutil
sqlparse==0.4.1
# via django
stripe==5.5.0
stripe==16.0.0
# via -r requirements.in
typing-extensions==4.15.0
# via
Expand All @@ -286,6 +286,7 @@ typing-extensions==4.15.0
# pydantic
# pydantic-core
# referencing
# stripe
# typing-inspection
typing-inspection==0.4.2
# via pydantic
Expand Down
Loading