Skip to content

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

Drop billing_email and billing_address from payment type

IKarbowiak5facc8570c2f
diff --git a/saleor/graphql/payment/tests/test_payment.py b/saleor/graphql/payment/tests/test_payment.py
index d8ed62df36..1349a49131 100644
--- a/saleor/graphql/payment/tests/test_payment.py
+++ b/saleor/graphql/payment/tests/test_payment.py
@@ -3,7 +3,6 @@ from unittest.mock import patch
import graphene
import pytest
-from django_countries.fields import Country
from ....checkout import calculations
from ....payment.error_codes import PaymentErrorCode
@@ -646,21 +645,6 @@ def test_payments_query(
}
actions
chargeStatus
- billingAddress {
- country {
- code
- country
- }
- firstName
- lastName
- cityArea
- countryArea
- city
- companyName
- streetAddress1
- streetAddress2
- postalCode
- }
transactions {
amount {
currency
@@ -686,21 +670,6 @@ def test_payments_query(
assert Decimal(total) == pay.total
assert data["total"]["currency"] == pay.currency
assert data["chargeStatus"] == PaymentChargeStatusEnum.FULLY_CHARGED.name
- assert data["billingAddress"] == {
- "firstName": pay.billing_first_name,
- "lastName": pay.billing_last_name,
- "city": pay.billing_city,
- "cityArea": pay.billing_city_area,
- "countryArea": pay.billing_country_area,
- "companyName": pay.billing_company_name,
- "streetAddress1": pay.billing_address_1,
- "streetAddress2": pay.billing_address_2,
- "postalCode": pay.billing_postal_code,
- "country": {
- "code": pay.billing_country_code,
- "country": Country(pay.billing_country_code).name,
- },
- }
assert data["actions"] == [OrderAction.REFUND.name]
txn = pay.transactions.get()
assert data["transactions"] == [
diff --git a/saleor/graphql/payment/types.py b/saleor/graphql/payment/types.py
index a44fd5f101..1d9ebe5700 100644
--- a/saleor/graphql/payment/types.py
+++ b/saleor/graphql/payment/types.py
@@ -1,9 +1,7 @@
import graphene
-from django_countries.fields import Country
from graphene import relay
from ...payment import models
-from ..account.types import Address
from ..core.connection import CountableDjangoObjectType
from ..core.types import Money
from .enums import OrderAction, PaymentChargeStatusEnum
@@ -78,7 +76,6 @@ class Payment(CountableDjangoObjectType):
captured_amount = graphene.Field(
Money, description="Total amount captured for this payment."
)
- billing_address = graphene.Field(Address, description="Customer billing address.")
transactions = graphene.List(
Transaction, description="List of all transactions within this payment."
)
@@ -103,7 +100,6 @@ class Payment(CountableDjangoObjectType):
"token",
"checkout",
"order",
- "billing_email",
"customer_ip_address",
]
@@ -126,21 +122,6 @@ class Payment(CountableDjangoObjectType):
def resolve_captured_amount(root: models.Payment, _info):
return root.get_captured_amount()
- @staticmethod
- def resolve_billing_address(root: models.Payment, _info):
- return Address(
- first_name=root.billing_first_name,
- last_name=root.billing_last_name,
- company_name=root.billing_company_name,
- street_address_1=root.billing_address_1,
- street_address_2=root.billing_address_2,
- city=root.billing_city,
- city_area=root.billing_city_area,
- postal_code=root.billing_postal_code,
- country=Country(root.billing_country_code),
- country_area=root.billing_country_area,
- )
-
@staticmethod
def resolve_transactions(root: models.Payment, _info):
return root.transactions.all()
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index c0a583c369..5acd77f8bd 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -3367,13 +3367,11 @@ type Payment implements Node {
token: String!
checkout: Checkout
order: Order
- billingEmail: String!
customerIpAddress: String
chargeStatus: PaymentChargeStatusEnum!
actions: [OrderAction]!
total: Money
capturedAmount: Money
- billingAddress: Address
transactions: [Transaction]
availableCaptureAmount: Money
availableRefundAmount: Money