Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add comments to explain the logic

jxltomce5f463a83d0
diff --git a/saleor/payment/models.py b/saleor/payment/models.py
index 13c06b852e..d4a351c838 100644
--- a/saleor/payment/models.py
+++ b/saleor/payment/models.py
@@ -114,6 +114,10 @@ class Payment(models.Model):
# The authorized amount should exclude the already captured amount
for transaction in self.transactions.filter(
kind=TransactionKind.CAPTURE, is_success=True).all():
+ # This code actually won't run since partial capture is not
+ # supported and zero money will return directly. It is put here
+ # intently to prove the correct logic
+ # in case partial capture is supported later though it is unlikely
money -= Money(
transaction.amount, self.currency or settings.DEFAULT_CURRENCY)