django/djangoproject.com

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

Open

#764 geöffnet am 4. Mai 2017

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (1.100 Forks)user submission
bugfundraisinggood first issue

Repository-Metriken

Stars
 (2.001 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 7T 20h) (25 gemergte PRs in 30 T)

Beschreibung

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