Fix #1230 -- Stripe: Recognize canceled sources in webhook

This commit is contained in:
Raphael Michel
2019-05-01 12:45:03 +02:00
parent 788f73d842
commit 2da93eba26

View File

@@ -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)