Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix circular import
Jakub Draganek1a3565fbf926
diff --git a/saleor/order/utils.py b/saleor/order/utils.pyindex f507815001..c20100c702 100644--- a/saleor/order/utils.py+++ b/saleor/order/utils.py@@ -15,7 +15,7 @@ from ..discount.models import NotApplicablefrom ..extensions.manager import get_extensions_managerfrom ..order import FulfillmentStatus, OrderStatus, emailsfrom ..order.models import Fulfillment, FulfillmentLine, Order, OrderLine-from ..payment import ChargeStatus, gateway+from ..payment import ChargeStatusfrom ..product.utils import (allocate_stock,deallocate_stock,@@ -209,6 +209,7 @@ def cancel_order(user, order, restock):charge_status=ChargeStatus.FULLY_REFUNDED)+ from ..payment import gatewayfor payment in payments:if payment.can_refund():gateway.refund(payment)diff --git a/saleor/payment/gateway.py b/saleor/payment/gateway.pyindex b042716d71..386b7b0744 100644--- a/saleor/payment/gateway.py+++ b/saleor/payment/gateway.py@@ -8,7 +8,7 @@ from ..extensions.manager import get_extensions_managerfrom . import GatewayError, PaymentError, TransactionKindfrom .models import Payment, Transactionfrom .utils import (- _gateway_postprocess,+ gateway_postprocess,clean_authorize,clean_capture,create_payment_information,@@ -35,7 +35,7 @@ def raise_payment_error(fn):def payment_postprocess(fn):def wrapped(*args, **kwargs):txn = fn(*args, **kwargs)- _gateway_postprocess(txn, txn.payment)+ gateway_postprocess(txn, txn.payment)return txnreturn wrappeddiff --git a/saleor/payment/utils.py b/saleor/payment/utils.pyindex 080f6f1cd8..7e86a52011 100644--- a/saleor/payment/utils.py+++ b/saleor/payment/utils.py@@ -373,7 +373,7 @@ def validate_gateway_response(response: GatewayResponse):@transaction.atomic-def _gateway_postprocess(transaction, payment):+def gateway_postprocess(transaction, payment):if not transaction.is_success:return@@ -421,7 +421,7 @@ def gateway_process_payment(**extras,)- _gateway_postprocess(transaction, payment)+ gateway_postprocess(transaction, payment)return transaction@@ -452,7 +452,7 @@ def gateway_confirm(payment) -> Transaction:payment=payment,payment_token=payment_token,)- _gateway_postprocess(transaction, payment)+ gateway_postprocess(transaction, payment)return transaction@@ -488,7 +488,7 @@ def gateway_refund(payment, amount: Decimal = None) -> Transaction:amount=amount,)- _gateway_postprocess(transaction, payment)+ gateway_postprocess(transaction, payment)return transaction