From 60f07545e5ddaa7b24027df97041f7930f8f79d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 10 Oct 2024 14:18:32 +0200 Subject: [PATCH] Do not fail to get Stripe refund failure reason if it is not present Closes #13590 --- modules/account_payment_stripe/payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/account_payment_stripe/payment.py b/modules/account_payment_stripe/payment.py index bb92d92271..3a237fa5f1 100644 --- a/modules/account_payment_stripe/payment.py +++ b/modules/account_payment_stripe/payment.py @@ -1153,7 +1153,7 @@ class Account(ModelSQL, ModelView): if not refunds: logger.error("charge.refund.updated: No refund '%s'", rf['id']) for refund in refunds: - refund.stripe_error_code = rf['failure_reason'] + refund.stripe_error_code = rf.get('failure_reason') if rf['status'] == 'pending': Refund.process([refund]) elif rf['status'] == 'succeeded':