Payment Session

In this document, you’ll learn what a payment session is.

What's a Payment Session?#

A payment session, represented by the PaymentSession data model, is a payment amount to be authorized. It’s associated with a payment provider that handles authorizing it.

A payment collection can have multiple payment sessions. Using this feature, you can implement payment in installments or payments using multiple providers.

Diagram showcasing how every payment session has a different payment provider


data Property#

Payment providers may need additional data to process the payment later. The PaymentSession data model has a data property used to store that data.

For example, the customer's ID in Stripe is stored in the data property.


Payment Session Status#

The status property 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 it’s 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.
Was this page helpful?
Edit this page
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break