From e1cb5b37e631e99e05ec67345716a33757662fb0 Mon Sep 17 00:00:00 2001 From: Changaco Date: Thu, 21 Mar 2024 10:11:57 +0100 Subject: [PATCH] fix handling of PayPal refunds lacking descriptions fixes LIBERAPAYCOM-24E --- liberapay/payin/paypal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liberapay/payin/paypal.py b/liberapay/payin/paypal.py index 9317a4dcf..b5d183c57 100644 --- a/liberapay/payin/paypal.py +++ b/liberapay/payin/paypal.py @@ -224,7 +224,7 @@ def record_order_result(db, payin, order): refund_amount = refund['amount'] refund_amount = Money(refund_amount['value'], refund_amount['currency_code']) reversed_amount += refund_amount - refund_description = refund['note_to_payer'] + refund_description = refund.get('note_to_payer') refund_status = REFUND_STATUSES_MAP[refund['status']] refund_error = refund.get('status_details', {}).get('reason') payin_refund = record_payin_refund(