Do not fail to get Stripe refund failure reason if it is not present

Closes #13590
This commit is contained in:
Cédric Krier committed 2024-10-10 14:18:32 +02:00
1 parent 0b5dd24b80
commit 60f07545e5
1 file changed
+1 -1
+1 -1
View File
@@ -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':