Skip to content

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

Drop PaymentSecureConfirm migration

IKarbowiak2be4e4e8cb6d
diff --git a/saleor/graphql/payment/mutations.py b/saleor/graphql/payment/mutations.py
index 82a0bc743f..ce00bfc13e 100644
--- a/saleor/graphql/payment/mutations.py
+++ b/saleor/graphql/payment/mutations.py
@@ -222,26 +222,3 @@ class PaymentVoid(BaseMutation):
except PaymentError as e:
raise ValidationError(str(e), code=PaymentErrorCode.PAYMENT_ERROR)
return PaymentVoid(payment=payment)
-
-
-class PaymentSecureConfirm(BaseMutation):
- payment = graphene.Field(Payment, description="Updated payment.")
-
- class Arguments:
- payment_id = graphene.ID(required=True, description="Payment ID.")
-
- class Meta:
- description = "Confirms payment in a two-step process like 3D secure"
- error_type_class = common_types.PaymentError
- error_type_field = "payment_errors"
-
- @classmethod
- def perform_mutation(cls, _root, info, payment_id):
- payment = cls.get_node_or_error(
- info, payment_id, field="payment_id", only_type=Payment
- )
- try:
- gateway.confirm(payment)
- except PaymentError as e:
- raise ValidationError(str(e), code=PaymentErrorCode.PAYMENT_ERROR)
- return PaymentSecureConfirm(payment=payment)
diff --git a/saleor/graphql/payment/schema.py b/saleor/graphql/payment/schema.py
index d1813986ef..7bc6111d40 100644
--- a/saleor/graphql/payment/schema.py
+++ b/saleor/graphql/payment/schema.py
@@ -3,7 +3,7 @@ import graphene
from ...core.permissions import OrderPermissions
from ..core.fields import PrefetchingConnectionField
from ..decorators import permission_required
-from .mutations import PaymentCapture, PaymentRefund, PaymentSecureConfirm, PaymentVoid
+from .mutations import PaymentCapture, PaymentRefund, PaymentVoid
from .resolvers import resolve_payments
from .types import Payment
@@ -31,4 +31,3 @@ class PaymentMutations(graphene.ObjectType):
payment_capture = PaymentCapture.Field()
payment_refund = PaymentRefund.Field()
payment_void = PaymentVoid.Field()
- payment_secure_confirm = PaymentSecureConfirm.Field()
diff --git a/saleor/graphql/payment/tests/test_payment.py b/saleor/graphql/payment/tests/test_payment.py
index 393bb9dd41..ea8139b6c0 100644
--- a/saleor/graphql/payment/tests/test_payment.py
+++ b/saleor/graphql/payment/tests/test_payment.py
@@ -627,40 +627,6 @@ def test_payment_refund_error(
assert not txn.is_success
-CONFIRM_QUERY = """
- mutation PaymentConfirm($paymentId: ID!) {
- paymentSecureConfirm(paymentId: $paymentId) {
- payment {
- id,
- chargeStatus
- }
- errors {
- field
- message
- }
- }
- }
-"""
-
-
-def test_payment_confirmation_success(
- user_api_client, payment_txn_to_confirm, graphql_address_data
-):
- payment = payment_txn_to_confirm
- payment_id = graphene.Node.to_global_id("Payment", payment.pk)
- variables = {"paymentId": payment_id}
- response = user_api_client.post_graphql(CONFIRM_QUERY, variables)
- content = get_graphql_content(response)
- data = content["data"]["paymentSecureConfirm"]
- assert not data["errors"]
-
- payment.refresh_from_db()
- assert payment.charge_status == ChargeStatus.FULLY_CHARGED
- assert payment.transactions.count() == 2
- txn = payment.transactions.last()
- assert txn.kind == TransactionKind.CAPTURE
-
-
def test_payments_query(
payment_txn_captured, permission_manage_orders, staff_api_client
):
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 9e3b5b13c5..9536b06794 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -2671,7 +2671,6 @@ type Mutation {
paymentCapture(amount: Decimal, paymentId: ID!): PaymentCapture
paymentRefund(amount: Decimal, paymentId: ID!): PaymentRefund
paymentVoid(paymentId: ID!): PaymentVoid
- paymentSecureConfirm(paymentId: ID!): PaymentSecureConfirm
pageCreate(input: PageInput!): PageCreate
pageDelete(id: ID!): PageDelete
pageBulkDelete(ids: [ID]!): PageBulkDelete
@@ -3448,12 +3447,6 @@ type PaymentRefund {
paymentErrors: [PaymentError!]!
}
-type PaymentSecureConfirm {
- errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
- payment: Payment
- paymentErrors: [PaymentError!]!
-}
-
type PaymentSource {
gateway: String!
creditCardInfo: CreditCard