Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Support setting partially refunded in gateway
Unknownc5d214e34c9e
diff --git a/saleor/payment/utils.py b/saleor/payment/utils.pyindex 038fd6953e..aaca243a6e 100644--- a/saleor/payment/utils.py+++ b/saleor/payment/utils.py@@ -366,10 +366,11 @@ def _gateway_postprocess(transaction, payment):elif transaction_kind == TransactionKind.REFUND:changed_fields = ['captured_amount']payment.captured_amount -= transaction.amount+ payment.charge_status = ChargeStatus.PARTIALLY_REFUNDEDif payment.captured_amount <= 0:payment.charge_status = ChargeStatus.FULLY_REFUNDEDpayment.is_active = False- changed_fields += ['charge_status', 'is_active']+ changed_fields += ['charge_status', 'is_active']payment.save(update_fields=changed_fields)