Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions www/apps/resources/generated/edit-dates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export const generatedEditDates = {
"references/auth/IAuthModuleService/methods/auth.IAuthModuleService.listAuthIdentities/page.mdx": "2024-12-09T13:21:36.253Z",
"references/auth/interfaces/auth.FilterableAuthIdentityProps/page.mdx": "2024-12-23T13:57:04.094Z",
"references/auth/interfaces/auth.IAuthModuleService/page.mdx": "2024-11-25T17:49:28.823Z",
"references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.completeCartWorkflow/page.mdx": "2024-12-25T08:43:13.426Z",
"references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.completeCartWorkflow/page.mdx": "2025-01-08T14:15:11.676Z",
"references/core_flows/Cart/core_flows.Cart.Workflows_Cart/page.mdx": "2024-12-23T12:30:23.632Z",
"references/core_flows/Common/Steps_Common/functions/core_flows.Common.Steps_Common.createRemoteLinkStep/page.mdx": "2025-01-07T12:54:14.097Z",
"references/core_flows/Common/Steps_Common/functions/core_flows.Common.Steps_Common.dismissRemoteLinkStep/page.mdx": "2025-01-07T12:54:14.100Z",
Expand Down Expand Up @@ -658,7 +658,7 @@ export const generatedEditDates = {
"references/types/types/types.UpdatePromotionRulesWorkflowDTO/page.mdx": "2024-12-09T13:21:35.497Z",
"references/core_flows/Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.setTaxLinesForItemsStep/page.mdx": "2024-12-25T08:43:13.394Z",
"references/core_flows/Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx": "2024-12-25T08:43:13.401Z",
"references/core_flows/Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartPaymentsStep/page.mdx": "2024-12-10T14:54:58.011Z",
"references/core_flows/Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartPaymentsStep/page.mdx": "2025-01-08T14:15:11.661Z",
"references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.addToCartWorkflow/page.mdx": "2024-12-25T08:43:13.424Z",
"references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx": "2024-12-25T08:43:13.429Z",
"references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.createCartWorkflow/page.mdx": "2025-01-07T12:54:14.019Z",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
slug: /references/medusa-workflows/steps/validateCartPaymentsStep
sidebar_label: validateCartPaymentsStep
tags:
- step
---

import { TypeList, WorkflowDiagram } from "docs-ui"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ slug: /references/medusa-workflows/completeCartWorkflow
sidebar_label: completeCartWorkflow
tags:
- query
- remote query
- logger
- payment
- order
- link
- cart
- inventory
- locking
- event bus
- workflow
---

Expand All @@ -16,7 +25,7 @@ This workflow completes a cart.

## Steps

<WorkflowDiagram workflow={{"name":"completeCartWorkflow","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":1}]}} />
<WorkflowDiagram workflow={{"name":"completeCartWorkflow","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":1},{"type":"when","condition":"{\n return !orderId\n }","depth":"2","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::\n\n","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":2},{"type":"step","name":"validateCartPaymentsStep","description":"This step validates a cart's payment sessions. Their status must\nbe `pending` or `requires_more`.\n\n","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartPaymentsStep/page.mdx","depth":2},{"type":"step","name":"authorizePaymentSessionStep","description":"This step authorizes a payment session.\n\n","link":"../../../../Payment/Steps_Payment/functions/core_flows.Payment.Steps_Payment.authorizePaymentSessionStep/page.mdx","depth":2},{"type":"step","name":"createOrdersStep","description":"This step creates one or more orders.\n\n","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrdersStep/page.mdx","depth":2},{"type":"step","name":"createRemoteLinkStep","description":"This step creates remote links between two records of linked data models.\n\nLearn more in the [Remote Link documentation.](https://docs.medusajs.com/learn/fundamentals/module-links/remote-link#create-link).\n\n","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.createRemoteLinkStep/page.mdx","depth":2},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.\n\n","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":2},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.\n\n","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.reserveInventoryStep/page.mdx","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":2}]}]}} />

## Input

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Text } from "@medusajs/ui"
import clsx from "clsx"
import Link from "next/link"
import React from "react"
import React, { useMemo } from "react"
import { WorkflowStepUi } from "types"
import { InlineCode, MarkdownContent, Tooltip } from "../../.."
import { Bolt, InformationCircle } from "@medusajs/icons"
Expand All @@ -15,6 +15,10 @@ export type WorkflowDiagramNodeProps = {
export const WorkflowDiagramStepNode = ({ step }: WorkflowDiagramNodeProps) => {
const stepId = step.name.split(".").pop()

const description = useMemo(() => {
return step.description?.replaceAll(/:::[a-z]*/g, "") || ""
}, [step.description])

return (
<Tooltip
tooltipClassName="!text-left max-w-[300px] text-pretty overflow-scroll"
Expand All @@ -27,12 +31,12 @@ export const WorkflowDiagramStepNode = ({ step }: WorkflowDiagramNodeProps) => {
satisfied.
</span>
)}
{step.description && (
{description && (
<MarkdownContent
allowedElements={["a", "strong", "code"]}
unwrapDisallowed={true}
>
{step.description}
{description}
</MarkdownContent>
)}
</>
Expand Down
Loading
Loading