Skip to content

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

Drop extraData and creditCard fields from Payment and gatewayResponse from Transaction

IKarbowiak032428e29b2d
diff --git a/saleor/graphql/payment/tests/test_payment.py b/saleor/graphql/payment/tests/test_payment.py
index ea8139b6c0..d8ed62df36 100644
--- a/saleor/graphql/payment/tests/test_payment.py
+++ b/saleor/graphql/payment/tests/test_payment.py
@@ -667,13 +667,6 @@ def test_payments_query(
amount
}
}
- creditCard {
- expMonth
- expYear
- brand
- firstDigits
- lastDigits
- }
}
}
}
@@ -713,13 +706,6 @@ def test_payments_query(
assert data["transactions"] == [
{"amount": {"currency": pay.currency, "amount": float(str(txn.amount))}}
]
- assert data["creditCard"] == {
- "expMonth": pay.cc_exp_month,
- "expYear": pay.cc_exp_year,
- "brand": pay.cc_brand,
- "firstDigits": pay.cc_first_digits,
- "lastDigits": pay.cc_last_digits,
- }
def test_query_payment(payment_dummy, user_api_client, permission_manage_orders):
diff --git a/saleor/graphql/payment/types.py b/saleor/graphql/payment/types.py
index be487babb1..a44fd5f101 100644
--- a/saleor/graphql/payment/types.py
+++ b/saleor/graphql/payment/types.py
@@ -25,7 +25,6 @@ class Transaction(CountableDjangoObjectType):
"kind",
"is_success",
"error",
- "gateway_response",
]
@staticmethod
@@ -89,9 +88,6 @@ class Payment(CountableDjangoObjectType):
available_refund_amount = graphene.Field(
Money, description="Maximum amount of money that can be refunded."
)
- credit_card = graphene.Field(
- CreditCard, description="The details of the card used for this payment."
- )
class Meta:
description = "Represents a payment of a given type."
@@ -109,7 +105,6 @@ class Payment(CountableDjangoObjectType):
"order",
"billing_email",
"customer_ip_address",
- "extra_data",
]
@staticmethod
@@ -163,16 +158,3 @@ class Payment(CountableDjangoObjectType):
if not root.can_capture():
return None
return root.get_charge_amount()
-
- @staticmethod
- def resolve_credit_card(root: models.Payment, _info):
- data = {
- "first_digits": root.cc_first_digits,
- "last_digits": root.cc_last_digits,
- "brand": root.cc_brand,
- "exp_month": root.cc_exp_month,
- "exp_year": root.cc_exp_year,
- }
- if not any(data.values()):
- return None
- return CreditCard(**data)
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 9536b06794..c0a583c369 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -3369,7 +3369,6 @@ type Payment implements Node {
order: Order
billingEmail: String!
customerIpAddress: String
- extraData: String!
chargeStatus: PaymentChargeStatusEnum!
actions: [OrderAction]!
total: Money
@@ -3378,7 +3377,6 @@ type Payment implements Node {
transactions: [Transaction]
availableCaptureAmount: Money
availableRefundAmount: Money
- creditCard: CreditCard
}
type PaymentCapture {
@@ -5006,7 +5004,6 @@ type Transaction implements Node {
kind: TransactionKind!
isSuccess: Boolean!
error: TransactionError
- gatewayResponse: JSONString!
amount: Money
}