Skip to content

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

Update schema

Jakub Draganek9240af05f239
diff --git a/saleor/graphql/account/resolvers.py b/saleor/graphql/account/resolvers.py
index 776475b215..5923f876b3 100644
--- a/saleor/graphql/account/resolvers.py
+++ b/saleor/graphql/account/resolvers.py
@@ -1,4 +1,5 @@
from itertools import chain
+
import graphene_django_optimizer as gql_optimizer
from django.db.models import Q
from i18naddress import get_validation_rules
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 273884bde6..9e1d013ee9 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -2510,7 +2510,6 @@ type Query {
reportProductSales(period: ReportingPeriod!, before: String, after: String, first: Int, last: Int): ProductVariantCountableConnection
payment(id: ID): Payment
payments(before: String, after: String, first: Int, last: Int): PaymentCountableConnection
- paymentStoredSources: [PaymentSource]
paymentClientToken(gateway: GatewaysEnum): String
page(id: ID, slug: String): Page
pages(query: String, before: String, after: String, first: Int, last: Int): PageCountableConnection
@@ -3047,6 +3046,7 @@ type User implements Node {
permissions: [PermissionDisplay]
avatar(size: Int): Image
events: [CustomerEvent]
+ storedPaymentSources: [PaymentSource]
}
input UserAddressInput {
diff --git a/saleor/order/utils.py b/saleor/order/utils.py
index 5058c23259..e031e9db71 100644
--- a/saleor/order/utils.py
+++ b/saleor/order/utils.py
@@ -16,7 +16,6 @@ from ..discount.models import NotApplicable
from ..order import FulfillmentStatus, OrderStatus, emails
from ..order.models import Fulfillment, FulfillmentLine, Order, OrderLine
from ..payment import ChargeStatus
-from ..payment.utils import gateway_refund, gateway_void
from ..product.utils import (
allocate_stock,
deallocate_stock,
@@ -198,6 +197,8 @@ def cancel_order(user, order, restock):
charge_status=ChargeStatus.FULLY_REFUNDED
)
+ from ..payment.utils import gateway_refund, gateway_void
+
for payment in payments:
if payment.can_refund():
gateway_refund(payment)
diff --git a/tests/api/test_payment.py b/tests/api/test_payment.py
index 072740835c..ea84f7e680 100644
--- a/tests/api/test_payment.py
+++ b/tests/api/test_payment.py
@@ -3,7 +3,6 @@ from decimal import Decimal
import graphene
import pytest
from prices import TaxedMoney
-from tests.api.utils import get_graphql_content
from saleor.core.utils import get_country_name_by_code
from saleor.graphql.payment.enums import (
@@ -14,6 +13,7 @@ from saleor.graphql.payment.enums import (
from saleor.payment.interface import CreditCardInfo, CustomerSource, TokenConfig
from saleor.payment.models import ChargeStatus, Payment, TransactionKind
from saleor.payment.utils import fetch_customer_id, store_customer_id
+from tests.api.utils import get_graphql_content
VOID_QUERY = """
mutation PaymentVoid($paymentId: ID!) {