django / django/djangoproject.com

fundraising: 'customer.subscription.deleted' webhook event always gets 404 response

Closed
#764 5 comments 0 reactions 0 assignees View on GitHub
bug fundraising good first issue
Dominant language
Python
Stars
2k
Forks
1.1k
Avg merge
2d 4h
Merged PRs (30d)
24

Description

The response to stripe 'customer.subscription.deleted' webhook event is always 404. The reason is:

In the `cancel_donation` view, `stripe_subscription_id` is set to an empty string https://github.com/django/djangoproject.com/blob/e5a4bf20fb58c463441c15d552c022b03f716858/fundraising/views.py#L178

In the `subscription_cancelled` webhook handler method, the donation object is fetched using `stripe_subscription_id` which was set to an empty string earlier.

https://github.com/django/djangoproject.com/blob/e5a4bf20fb58c463441c15d552c022b03f716858/fundraising/views.py#L232-L233

So, the response will always be 404 and no cancellation email will be sent to the donor.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in fundraising/views.py at cancel_donation around line 178 and subscription_cancelled around lines 232–233. Trace the subscription ID between these handlers, then verify that a customer.subscription.deleted webhook can find the donation, returns successfully instead of 404, and sends the cancellation email.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
payments
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.