Files
medusa-store/www/apps/resources/app/commerce-modules/payment/payment-session/page.mdx
Shahed Nasser 2c5ba408d4 docs: edits and fixes to commerce module docs (#7468)
Apply edits and fixes to the commerce modules docs
2024-05-29 11:08:06 +00:00

36 lines
1.5 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 Session`,
}
# {metadata.title}
In this document, youll learn what a payment session is.
## What's a Payment Session?
A payment session, represented by the [PaymentSession data model](/references/payment/modules/PaymentSession), is a payment amount to be authorized. Its associated with a payment provider that handles authorizing it.
A payment collection can have multiple payment sessions. For example, during checkout, when a customer chooses between paying with Stripe or PayPal, each of these payment options is a payment session associated with a payment provider (Stripe or PayPal).
![Diagram showcasing how every payment session has a different payment provider](https://res.cloudinary.com/dza7lstvk/image/upload/v1711565056/Medusa%20Resources/payment-session-provider_guxzqt.jpg)
---
## data field
Payment providers may need additional data to process the payment later. The `PaymentSession` data model has a `data` field used to store that data.
For example, the customer's ID in Stripe is stored in the `data` field.
---
## Payment Session Status
The `status` field of a payment session indicates its current status. Its value can be:
- `pending`: The payment session is awaiting authorization.
- `requires_more`: The payment session requires an action before its authorized. For example, to enter a 3DS code.
- `authorized`: The payment session is authorized.
- `error`: An error occurred while authorizing the payment.
- `canceled`: The authorization of the payment session has been canceled.