Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix bug where captured amount less than 0 should also be taken as fully refunded
Unknown5b2900754bfb
diff --git a/saleor/payment/utils.py b/saleor/payment/utils.pyindex b4387775be..ee75a01e05 100644--- a/saleor/payment/utils.py+++ b/saleor/payment/utils.py@@ -292,7 +292,7 @@ def _gateway_postprocess(transaction, payment):elif transaction_kind == TransactionKind.REFUND:changed_fields = ['captured_amount']payment.captured_amount -= transaction.amount- if not payment.captured_amount:+ if payment.captured_amount <= 0:payment.charge_status = ChargeStatus.FULLY_REFUNDEDpayment.is_active = Falsechanged_fields += ['charge_status', 'is_active']