Skip to content

Commit

Permalink
fix handling of PayPal refunds lacking descriptions
Browse files Browse the repository at this point in the history
fixes LIBERAPAYCOM-24E
  • Loading branch information
Changaco committed Mar 21, 2024
1 parent 1ee74a3 commit e1cb5b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion liberapay/payin/paypal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Check warning on line 227 in liberapay/payin/paypal.py

View check run for this annotation

Codecov / codecov/patch

liberapay/payin/paypal.py#L227

Added line #L227 was not covered by tests
refund_status = REFUND_STATUSES_MAP[refund['status']]
refund_error = refund.get('status_details', {}).get('reason')
payin_refund = record_payin_refund(
Expand Down

0 comments on commit e1cb5b3

Please sign in to comment.