From 2da93eba265da663f009b37931036248638fa049 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 1 May 2019 12:45:03 +0200 Subject: [PATCH] Fix #1230 -- Stripe: Recognize canceled sources in webhook --- src/pretix/plugins/stripe/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pretix/plugins/stripe/views.py b/src/pretix/plugins/stripe/views.py index a152775b0b..48d382b0fe 100644 --- a/src/pretix/plugins/stripe/views.py +++ b/src/pretix/plugins/stripe/views.py @@ -348,6 +348,10 @@ def source_webhook(event, event_json, source_id, rso): 'info': str(src) }) payment.save() + elif src.status == 'canceled' and payment.state in (Order.STATUS_PENDING, OrderPayment.PAYMENT_STATE_CREATED): + payment.info = str(src) + payment.state = OrderPayment.PAYMENT_STATE_CANCELED + payment.save() return HttpResponse(status=200)