Skip to content

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

Added missing description to payment module. (#13546)

Bhuvnesh41d25d03c145
diff --git a/CHANGELOG.md b/CHANGELOG.md
index aab883e8d0..f8be1b74fe 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -139,7 +139,7 @@ Shipping methods can be removed by the user after it has been assigned to a chec
- Add missing descriptions to menu module - #13409 by @devilsautumn
- Add missing descriptions to page module - #13536 by @devilsautumn
- Fix seo field to accept null value - #13512 by @ssuraliya
-
+- Add missing descriptions to payment module - #13546 by @devilsautumn
# 3.14.0
diff --git a/saleor/graphql/payment/mutations/payment/payment_gateway_initialize.py b/saleor/graphql/payment/mutations/payment/payment_gateway_initialize.py
index 1d51d9f220..093619d415 100644
--- a/saleor/graphql/payment/mutations/payment/payment_gateway_initialize.py
+++ b/saleor/graphql/payment/mutations/payment/payment_gateway_initialize.py
@@ -36,7 +36,9 @@ class PaymentGatewayToInitialize(BaseInputObjectType):
class PaymentGatewayInitialize(TransactionSessionBase):
- gateway_configs = common_types.NonNullList(PaymentGatewayConfig)
+ gateway_configs = common_types.NonNullList(
+ PaymentGatewayConfig, description="List of payment gateway configurations."
+ )
class Arguments:
id = graphene.ID(
diff --git a/saleor/graphql/payment/mutations/payment/payment_initialize.py b/saleor/graphql/payment/mutations/payment/payment_initialize.py
index c05dca991c..9c1d206e8b 100644
--- a/saleor/graphql/payment/mutations/payment/payment_initialize.py
+++ b/saleor/graphql/payment/mutations/payment/payment_initialize.py
@@ -14,7 +14,9 @@ from ...types import PaymentInitialized
class PaymentInitialize(BaseMutation):
- initialized_payment = graphene.Field(PaymentInitialized, required=False)
+ initialized_payment = graphene.Field(
+ PaymentInitialized, required=False, description="Payment that was initialized."
+ )
class Arguments:
gateway = graphene.String(
diff --git a/saleor/graphql/payment/types.py b/saleor/graphql/payment/types.py
index 51e515d21e..efb79b086a 100644
--- a/saleor/graphql/payment/types.py
+++ b/saleor/graphql/payment/types.py
@@ -43,14 +43,28 @@ from .enums import (
class Transaction(ModelObjectType[models.Transaction]):
- id = graphene.GlobalID(required=True)
- created = graphene.DateTime(required=True)
- payment = graphene.Field(lambda: Payment, required=True)
- token = graphene.String(required=True)
- kind = TransactionKindEnum(required=True)
- is_success = graphene.Boolean(required=True)
- error = graphene.String()
- gateway_response = JSONString(required=True)
+ id = graphene.GlobalID(required=True, description="ID of the transaction.")
+ created = graphene.DateTime(
+ required=True, description="Date and time which transaction was created."
+ )
+ payment = graphene.Field(
+ lambda: Payment,
+ required=True,
+ description="Determines the payment associated with a transaction.",
+ )
+ token = graphene.String(
+ required=True, description="Unique token associated with a transaction."
+ )
+ kind = TransactionKindEnum(
+ required=True, description="Determines the type of transaction."
+ )
+ is_success = graphene.Boolean(
+ required=True, description="Determines if the transaction was successful."
+ )
+ error = graphene.String(description="Error associated with transaction, if any.")
+ gateway_response = JSONString(
+ required=True, description="Response returned by payment gateway."
+ )
amount = graphene.Field(Money, description="Total amount of the transaction.")
class Meta:
@@ -113,15 +127,33 @@ class PaymentSource(BaseObjectType):
class Payment(ModelObjectType[models.Payment]):
- id = graphene.GlobalID(required=True)
- gateway = graphene.String(required=True)
- is_active = graphene.Boolean(required=True)
- created = graphene.DateTime(required=True)
- modified = graphene.DateTime(required=True)
- token = graphene.String(required=True)
- checkout = graphene.Field("saleor.graphql.checkout.types.Checkout")
- order = graphene.Field("saleor.graphql.order.types.Order")
- payment_method_type = graphene.String(required=True)
+ id = graphene.GlobalID(required=True, description="ID of the payment.")
+ gateway = graphene.String(
+ required=True, description="Payment gateway used for payment."
+ )
+ is_active = graphene.Boolean(
+ required=True, description="Determines if the payment is active or not."
+ )
+ created = graphene.DateTime(
+ required=True, description="Date and time at which payment was created."
+ )
+ modified = graphene.DateTime(
+ required=True, description="Date and time at which payment was modified."
+ )
+ token = graphene.String(
+ required=True, description="Unique token associated with a payment."
+ )
+ checkout = graphene.Field(
+ "saleor.graphql.checkout.types.Checkout",
+ description="Checkout associated with a payment.",
+ )
+ order = graphene.Field(
+ "saleor.graphql.order.types.Order",
+ description="Order associated with a payment.",
+ )
+ payment_method_type = graphene.String(
+ required=True, description="Type of method used for payment."
+ )
customer_ip_address = PermissionsField(
graphene.String,
description="IP address of the user who created the payment.",
@@ -266,7 +298,10 @@ class PaymentInitialized(BaseObjectType):
class TransactionEvent(ModelObjectType[models.TransactionEvent]):
- created_at = graphene.DateTime(required=True)
+ created_at = graphene.DateTime(
+ required=True,
+ description="Date and time at which a transaction event was created.",
+ )
psp_reference = graphene.String(
description="PSP reference of transaction." + ADDED_IN_313, required=True
)
@@ -343,8 +378,14 @@ class TransactionEvent(ModelObjectType[models.TransactionEvent]):
class TransactionItem(ModelObjectType[models.TransactionItem]):
- created_at = graphene.DateTime(required=True)
- modified_at = graphene.DateTime(required=True)
+ created_at = graphene.DateTime(
+ required=True,
+ description="Date and time at which payment transaction was created.",
+ )
+ modified_at = graphene.DateTime(
+ required=True,
+ description="Date and time at which payment transaction was modified.",
+ )
actions = NonNullList(
TransactionActionEnum,
description=(
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 8ae303e646..102328ff59 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -10657,7 +10657,11 @@ type TransactionItem implements Node & ObjectWithMetadata @doc(category: "Paymen
Added in Saleor 3.3.
"""
metafields(keys: [String!]): Metadata
+
+ """Date and time at which payment transaction was created."""
createdAt: DateTime!
+
+ """Date and time at which payment transaction was modified."""
modifiedAt: DateTime!
"""
@@ -11593,6 +11597,7 @@ enum OrderChargeStatusEnum @doc(category: "Orders") {
"""Represents a payment of a given type."""
type Payment implements Node & ObjectWithMetadata @doc(category: "Payments") {
+ """ID of the payment."""
id: ID!
"""List of private metadata items. Requires staff permissions to access."""
@@ -11632,13 +11637,29 @@ type Payment implements Node & ObjectWithMetadata @doc(category: "Payments") {
Added in Saleor 3.3.
"""
metafields(keys: [String!]): Metadata
+
+ """Payment gateway used for payment."""
gateway: String!
+
+ """Determines if the payment is active or not."""
isActive: Boolean!
+
+ """Date and time at which payment was created."""
created: DateTime!
+
+ """Date and time at which payment was modified."""
modified: DateTime!
+
+ """Unique token associated with a payment."""
token: String!
+
+ """Checkout associated with a payment."""
checkout: Checkout
+
+ """Order associated with a payment."""
order: Order
+
+ """Type of method used for payment."""
paymentMethodType: String!
"""
@@ -11691,13 +11712,28 @@ type Payment implements Node & ObjectWithMetadata @doc(category: "Payments") {
"""An object representing a single payment."""
type Transaction implements Node @doc(category: "Payments") {
+ """ID of the transaction."""
id: ID!
+
+ """Date and time which transaction was created."""
created: DateTime!
+
+ """Determines the payment associated with a transaction."""
payment: Payment!
+
+ """Unique token associated with a transaction."""
token: String!
+
+ """Determines the type of transaction."""
kind: TransactionKind!
+
+ """Determines if the transaction was successful."""
isSuccess: Boolean!
+
+ """Error associated with transaction, if any."""
error: String
+
+ """Response returned by payment gateway."""
gatewayResponse: JSONString!
"""Total amount of the transaction."""
@@ -12101,6 +12137,8 @@ type OrderGrantedRefundLine {
type TransactionEvent implements Node @doc(category: "Payments") {
"""The ID of the object."""
id: ID!
+
+ """Date and time at which a transaction event was created."""
createdAt: DateTime!
"""
@@ -22370,6 +22408,7 @@ type PaymentVoid @doc(category: "Payments") {
"""Initializes payment process when it is required by gateway."""
type PaymentInitialize @doc(category: "Payments") {
+ """Payment that was initialized."""
initializedPayment: PaymentInitialized
paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")
errors: [PaymentError!]!
@@ -22755,6 +22794,7 @@ Added in Saleor 3.13.
Note: this API is currently in Feature Preview and can be subject to changes at later point.
"""
type PaymentGatewayInitialize @doc(category: "Payments") {
+ """List of payment gateway configurations."""
gatewayConfigs: [PaymentGatewayConfig!]
errors: [PaymentGatewayInitializeError!]!
}