Files
medusa-store/www/apps/resources/app/commerce-modules/payment/payment-collection/page.mdx
Shahed Nasser 11120a8b7e docs: improve commerce modules [3/n] (#9510)
Improve and add docs for Order and Payment modules

[3/n]

Closes DOCS-966
Closes #9485
2024-10-14 07:20:35 +00:00

40 lines
1.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export const metadata = {
title: `Payment Collection`,
}
# {metadata.title}
In this document, youll learn what a payment collection is and how the Medusa application uses it with the Cart Module.
## What's a Payment Collection?
A payment collection stores payment details related to a resource, such as a cart or an order. Its represented by the [PaymentCollection data model](/references/payment/models/PaymentCollection).
Every purchase or request for payment starts with a payment collection. The collection holds details necessary to complete the payment, including:
- The [payment sessions](../payment-session/page.mdx) that represents the payment amount to authorize.
- The [payments](../payment/page.mdx) that are created when a payment session is authorized. They can be captured and refunded.
- The [payment providers](../payment-provider/page.mdx) that handle the processing of each payment session, including the authorization, capture, and refund.
---
## Multiple Payments
The payment collection supports multiple payment sessions and payments.
You can use this to accept payments in increments or split payments across payment providers.
![Diagram showcasing how a payment collection can have multiple payment sessions and payments](https://res.cloudinary.com/dza7lstvk/image/upload/v1711554695/Medusa%20Resources/payment-collection-multiple-payments_oi3z3n.jpg)
---
## Usage with the Cart Module
The Cart Module provides cart management features. However, it doesnt provide any features related to accepting payment.
During checkout, the Medusa application links a cart to a payment collection, which will be used for further payment processing.
It also implements the payment flow during checkout as explained in [this documentation](../payment-flow/page.mdx).
![Diagram showcasing the relation between the Payment and Cart modules](https://res.cloudinary.com/dza7lstvk/image/upload/v1711537849/Medusa%20Resources/cart-payment_ixziqm.jpg)