docs: add TSDoc for payment processor + generate docs (#5917)

* added tsdocs for payment processor

* generated reference for payment processor
This commit is contained in:
Shahed Nasser
2023-12-18 14:02:18 +02:00
committed by GitHub
parent e63f4e6c7a
commit ddc6cc13a0
73 changed files with 34162 additions and 17470 deletions

View File

@@ -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 youre 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)
}
// ...
}
```