Skip to content

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

Check for confirmation flag in checkout complete

Jakub Draganekccb0b13299b7
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index ad376a3485..ac9545c01e 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -683,6 +683,7 @@ type CheckoutClearPrivateMeta {
type CheckoutComplete {
errors: [Error!]
order: Order
+ confirmationNeeded: Boolean
checkoutErrors: [CheckoutError!]
}
diff --git a/tests/api/test_checkout.py b/tests/api/test_checkout.py
index 500bafbbff..abcc5ed9b0 100644
--- a/tests/api/test_checkout.py
+++ b/tests/api/test_checkout.py
@@ -1158,6 +1158,7 @@ MUTATION_CHECKOUT_COMPLETE = """
field,
message
}
+ confirmationNeeded
}
}
"""
@@ -1412,6 +1413,7 @@ def test_checkout_complete_confirmation_needed(
content = get_graphql_content(response)
data = content["data"]["checkoutComplete"]
assert not data["errors"]
+ assert data["confirmationNeeded"] is True
new_orders_count = Order.objects.count()
assert new_orders_count == orders_count
@@ -1424,7 +1426,8 @@ def test_checkout_complete_confirmation_needed(
response = user_api_client.post_graphql(MUTATION_CHECKOUT_COMPLETE, variables)
content = get_graphql_content(response)
data = content["data"]["checkoutComplete"]
- assert not data["errors"]
+ assert not dataconfirmationNeeded["errors"]
+ assert not data["confirmationNeeded"]
mock_get_manager.confirm_payment.assert_called_once()