docs: add TSDoc for payment processor + generate docs (#5917)
* added tsdocs for payment processor * generated reference for payment processor
This commit is contained in:
@@ -24,13 +24,15 @@ import { AbstractFulfillmentService } from "@medusajs/medusa"
|
||||
class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
// methods here...
|
||||
}
|
||||
|
||||
export default MyFulfillmentService
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Identifier Property
|
||||
|
||||
The `FulfillmentProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the class is used when the fulfillment provider is created in the database.
|
||||
The `FulfillmentProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the fulfillment provider service is used when the fulfillment provider is added to the database.
|
||||
|
||||
The value of this property is also used to reference the fulfillment provider throughout Medusa. For example, it is used to [add a fulfillment provider](https://docs.medusajs.com/api/admin#regions\_postregionsregionfulfillmentproviders) to a region.
|
||||
|
||||
@@ -54,8 +56,15 @@ Additionally, if you’re creating your fulfillment provider as an external plug
|
||||
|
||||
```ts
|
||||
class MyFulfillmentService extends AbstractFulfillmentService {
|
||||
static identifier = "my-fulfillment"
|
||||
// ...
|
||||
constructor(container, options) {
|
||||
super(container)
|
||||
// you can access options here
|
||||
|
||||
// you can also initialize a client that
|
||||
// communicates with a third-party service.
|
||||
this.client = new Client(options)
|
||||
}
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user