Stripe: Automatically fail payments if the payment_intent has failed.

This commit is contained in:
Martin Gross
2022-09-14 10:07:34 +02:00
parent 690edf1c68
commit 241169873b

View File

@@ -433,6 +433,9 @@ def paymentintent_webhook(event, event_json, paymentintent_id, rso):
defaults={'order': rso.payment.order, 'payment': rso.payment}
)
if event_json["type"] == "payment_intent.payment_failed":
rso.payment.fail(info=event_json)
return HttpResponse(status=200)