docs: tax provider updates for next release (#12431)
* docs: tax provider updates for next release * change images * fix vale error * fix vale errors * generate
This commit is contained in:
@@ -6,7 +6,7 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
In this document, you’ll learn what a payment module provider is.
|
||||
In this guide, you’ll learn about the Payment Module Provider and how it's used.
|
||||
|
||||
<Note title="Looking for no-code docs?">
|
||||
|
||||
@@ -14,14 +14,18 @@ Refer to this [Medusa Admin User Guide](!user-guide!/settings/regions) to learn
|
||||
|
||||
</Note>
|
||||
|
||||
## What's a Payment Module Provider?
|
||||
---
|
||||
|
||||
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.
|
||||
## What is a Payment Module Provider?
|
||||
|
||||
The Payment Module Provider handles payment processing in the Medusa application. It integrates third-party payment services, such as [Stripe](./stripe/page.mdx).
|
||||
|
||||
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.
|
||||
|
||||
After the payment session is authorized, the payment provider is associated with the resulting payment and handles its payment processing, such as to capture or refund payment.
|
||||
|
||||

|
||||
|
||||
### List of Payment Module Providers
|
||||
|
||||
<CardList
|
||||
@@ -33,35 +37,63 @@ After the payment session is authorized, the payment provider is associated with
|
||||
]}
|
||||
/>
|
||||
|
||||
|
||||
---
|
||||
|
||||
## System Payment Provider
|
||||
### Default 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.
|
||||
|
||||
<Note title="Tip">
|
||||
|
||||
The identifier of the system payment provider is `pp_system`.
|
||||
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## How are Payment Providers Created?
|
||||
## How to Create a Custom Payment Provider?
|
||||
|
||||
A payment provider is a module whose main service extends the `AbstractPaymentProvider` imported from `@medusajs/framework/utils`.
|
||||
|
||||
The module can have multiple payment provider services, where each is registered as a separate payment provider.
|
||||
|
||||
Refer to [this guide](/references/payment/provider) on how to create a payment provider for the Payment Module.
|
||||
|
||||
---
|
||||
|
||||
## Configure Payment Providers
|
||||
|
||||
The Payment Module accepts a `providers` option that allows you to register providers in your application.
|
||||
|
||||
Learn more about this option in [this documentation](../module-options/page.mdx#providers).
|
||||
After you create a payment provider, you can enable it as a payment provider in a region using the [Medusa Admin dashboard](!user-guide!/settings/regions).
|
||||
|
||||
---
|
||||
|
||||
## PaymentProvider Data Model
|
||||
## How are Payment Providers Registered?
|
||||
|
||||
When the Medusa application starts and registers the payment providers, it also creates a record of the `PaymentProvider` data model if none exists.
|
||||
### Configure Payment Module's Providers
|
||||
|
||||
This data model is used to reference a payment provider and determine whether it’s installed in the application.
|
||||
The Payment Module accepts a `providers` option that allows you to configure the providers registered in your application.
|
||||
|
||||
Learn more about this option in the [Module Options](../module-options/page.mdx) guide.
|
||||
|
||||
### Registration on Application Start
|
||||
|
||||
When the Medusa application starts, it registers the Payment Module Providers defined in the `providers` option of the Payment Module.
|
||||
|
||||
For each Payment Module Provider, the Medusa application finds all payment provider services defined in them to register.
|
||||
|
||||
### PaymentProvider Data Model
|
||||
|
||||
A registered payment provider is represented by the [PaymentProvider data model](/references/payment/models/PaymentProvider) in the Medusa application.
|
||||
|
||||

|
||||
|
||||
This data model is used to reference a service in the Payment Module Provider and determine whether it's installed in the application.
|
||||
|
||||
The `PaymentProvider` data model has the following properties:
|
||||
|
||||
- `id`: The unique identifier of the Payment Module Provider. The ID's format is `pp_{identifier}_{id}`, where:
|
||||
- `identifier` is the value of the `identifier` property in the Payment Module Provider's service.
|
||||
- `id` is the value of the `id` property of the Payment Module Provider in `medusa-config.ts`.
|
||||
- `is_enabled`: A boolean indicating whether the payment provider is enabled.
|
||||
|
||||
### How to Remove a Payment Provider?
|
||||
|
||||
If you remove a payment provider from the `providers` option, the Medusa application will not remove the associated `PaymentProvider` data model record.
|
||||
|
||||
Instead, the Medusa application will set the `is_enabled` property of the `PaymentProvider`'s record to `false`. This allows you to re-enable the payment provider later if needed by adding it back to the `providers` option.
|
||||
|
||||
Reference in New Issue
Block a user