Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
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.pyindex 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 patchimport grapheneimport pytest-from django_countries.fields import Countryfrom ....checkout import calculationsfrom ....payment.error_codes import PaymentErrorCode@@ -646,21 +645,6 @@ def test_payments_query(}actionschargeStatus- 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.totalassert data["total"]["currency"] == pay.currencyassert 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.pyindex 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 Countryfrom graphene import relayfrom ...payment import models-from ..account.types import Addressfrom ..core.connection import CountableDjangoObjectTypefrom ..core.types import Moneyfrom .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,- )-@staticmethoddef resolve_transactions(root: models.Payment, _info):return root.transactions.all()diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex c0a583c369..5acd77f8bd 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -3367,13 +3367,11 @@ type Payment implements Node {token: String!checkout: Checkoutorder: Order- billingEmail: String!customerIpAddress: StringchargeStatus: PaymentChargeStatusEnum!actions: [OrderAction]!total: MoneycapturedAmount: Money- billingAddress: Addresstransactions: [Transaction]availableCaptureAmount: MoneyavailableRefundAmount: Money