@medusajs/core-flows
Version:
Set of workflow definitions for Medusa
70 lines • 2.49 kB
TypeScript
import { PaymentCollectionDTO } from "@medusajs/framework/types";
/**
* The details of the payment collection to validate.
*/
export type ThrowUnlessPaymentCollectionNotePaidInput = {
/**
* The payment collection to validate.
*/
paymentCollection: PaymentCollectionDTO;
};
/**
* This step validates that the payment collection is not paid. If not valid,
* the step will throw an error.
*
* :::note
*
* You can retrieve a payment collection's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),
* or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).
*
* :::
*
* @example
* const data = throwUnlessPaymentCollectionNotPaid({
* paymentCollection: {
* id: "paycol_123",
* // other payment details...
* }
* })
*/
export declare const throwUnlessPaymentCollectionNotPaid: import("@medusajs/framework/workflows-sdk").StepFunction<ThrowUnlessPaymentCollectionNotePaidInput, unknown>;
/**
* The data to mark a payment collection as paid.
*/
export type MarkPaymentCollectionAsPaidInput = {
/**
* The ID of the payment collection to mark as paid.
*/
payment_collection_id: string;
/**
* The ID of the order that the payment collection belongs to.
*/
order_id: string;
/**
* The ID of the user marking the payment collection as completed.
*/
captured_by?: string;
};
export declare const markPaymentCollectionAsPaidId = "mark-payment-collection-as-paid";
/**
* This workflow marks a payment collection for an order as paid. It's used by the
* [Mark Payment Collection as Paid Admin API Route](https://docs.medusajs.com/api/admin#payment-collections_postpaymentcollectionsidmarkaspaid).
*
* You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
* marking a payment collection for an order as paid.
*
* @example
* const { result } = await markPaymentCollectionAsPaid(container)
* .run({
* input: {
* order_id: "order_123",
* payment_collection_id: "paycol_123",
* }
* })
*
* @summary
*
* Mark a payment collection for an order as paid.
*/
export declare const markPaymentCollectionAsPaid: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<MarkPaymentCollectionAsPaidInput, import("@medusajs/framework/types").PaymentDTO | null, []>;
//# sourceMappingURL=mark-payment-collection-as-paid.d.ts.map