docs: improve commerce modules [3/n] (#9510)
Improve and add docs for Order and Payment modules [3/n] Closes DOCS-966 Closes #9485
This commit is contained in:
@@ -10,7 +10,7 @@ In this document, you’ll learn what a payment module provider is.
|
||||
|
||||
## What's a Payment Module Provider?
|
||||
|
||||
A payment module provider registers a payment provider that handles payment processing. It can integrate third-party payment providers, such as Stripe.
|
||||
A payment module provider registers a payment provider that handles payment processing in the Medusa application. It integrates third-party payment providers, such as Stripe.
|
||||
|
||||
To authorize a payment amount with a payment provider, a payment session is created and associated with that payment provider. The payment provider is then used to handle the authorization.
|
||||
|
||||
@@ -24,20 +24,18 @@ After the payment session is authorized, the payment provider is associated with
|
||||
|
||||
## System Payment Provider
|
||||
|
||||
The Payment Module provides a `system` payment provider that acts as a placeholder payment provider. It doesn’t handle payment processing and delegates that to the merchant. It acts similarly to a cash-on-delivery (COD) payment method.
|
||||
The Payment Module provides a `system` payment provider that acts as a placeholder payment provider.
|
||||
|
||||
It doesn’t handle payment processing and delegates that to the merchant. It acts similarly to a cash-on-delivery (COD) payment method.
|
||||
|
||||
---
|
||||
|
||||
## How are Payment Providers Created?
|
||||
|
||||
A payment provider is a TypeScript or JavaScript class that extends the `AbstractPaymentProvider` imported from `@medusajs/framework/utils`. It can then be exported as the main service of a module.
|
||||
|
||||
<Note title="Tip">
|
||||
A payment provider is a module whose main service extends the `AbstractPaymentProvider` imported from `@medusajs/framework/utils`.
|
||||
|
||||
Refer to [this guide](/references/payment/provider) on how to create a payment provider for the Payment Module.
|
||||
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Configure Payment Providers
|
||||
@@ -50,4 +48,6 @@ Learn more about this option in [this documentation](../module-options/page.mdx#
|
||||
|
||||
## PaymentProvider Data Model
|
||||
|
||||
When the Medusa application starts and registers the payment providers, it also creates a record of the `PaymentProvider` data model if none exists. This data model is used to reference a payment provider and determine whether it’s installed in the application.
|
||||
When the Medusa application starts and registers the payment providers, it also creates a record of the `PaymentProvider` data model if none exists.
|
||||
|
||||
This data model is used to reference a payment provider and determine whether it’s installed in the application.
|
||||
|
||||
@@ -12,14 +12,6 @@ export const metadata = {
|
||||
|
||||
In this document, you’ll learn about the Stripe Module Provider and how to install and use it in the Payment Module.
|
||||
|
||||
## Features
|
||||
|
||||
[Stripe](https://stripe.com/) is a battle-tested and unified platform for transaction handling. Stripe supplies you with the technical components needed to handle transactions safely and all the analytical features necessary to gain insight into your sales.
|
||||
|
||||
These features are also available in a safe test environment, allowing for a concern-free development process.
|
||||
|
||||
---
|
||||
|
||||
## Register the Stripe Module Provider
|
||||
|
||||
<Prerequisites items={[
|
||||
@@ -103,7 +95,7 @@ STRIPE_API_KEY=<YOUR_STRIPE_API_KEY>
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
-
|
||||
\-
|
||||
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
@@ -125,7 +117,7 @@ STRIPE_API_KEY=<YOUR_STRIPE_API_KEY>
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
-
|
||||
\-
|
||||
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
@@ -198,6 +190,8 @@ STRIPE_API_KEY=<YOUR_STRIPE_API_KEY>
|
||||
</Table.Body>
|
||||
</Table>
|
||||
|
||||
---
|
||||
|
||||
## Use Provider
|
||||
|
||||
To use the Stripe provider, create a payment session for the provider:
|
||||
@@ -217,3 +211,9 @@ const paymentSession =
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Useful Guides
|
||||
|
||||
- [Storefront guide: Add Stripe payment method during checkout](../../../../storefront-development/checkout/payment/stripe/page.mdx).
|
||||
|
||||
Reference in New Issue
Block a user