docs: generate references manually for 2.4.0 (#11171)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-01-27 17:00:42 +02:00
1 parent 65d8d6dc0e
commit 4ccb489dbe
444 files changed
+236833 -244966

No files matched your search

@@ -0,0 +1,46 @@
---
displayed_sidebar: paymentReference
slug: /references/payment/listAndCountPaymentMethods
sidebar_label: listAndCountPaymentMethods
---
import { TypeList } from "docs-ui"
# listAndCountPaymentMethods - Payment Module Reference
This documentation provides a reference to the `listAndCountPaymentMethods` method. This belongs to the Payment Module.
<Note>
You should only use this methods when implementing complex customizations. For common cases, check out [available workflows instead](/medusa-workflows-reference).
</Note>
This method retrieves all payment methods along with the total count of available payment methods, based on the context and configuration.
## Example
To retrieve a list of payment methods for a customer:
```ts
const [paymentMethods, count] =
await paymentModuleService.listAndCountPaymentMethods({
provider_id: "pp_stripe_stripe",
context: {
customer: {
id: "cus_123",
metadata: {
pp_stripe_stripe_customer_id: "str_1234"
}
},
},
})
```
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterablePaymentMethodProps](../../../interfaces/payment.FilterablePaymentMethodProps/page.mdx)","description":"The filters to apply on the retrieved payment methods.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"provider_id","type":"`string`","description":"Filter the payment methods by provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[PaymentProviderContext](../../../interfaces/payment.PaymentProviderContext/page.mdx)","description":"Filter the payment methods by the context of their associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"billing_address","type":"Partial&#60;[AddressDTO](../../../types/payment.AddressDTO/page.mdx)&#62;","description":"The payment's billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The associated customer's email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"session_id","type":"`string`","description":"The ID of payment session the provider payment is associated with.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"Partial&#60;[CustomerDTO](../../../interfaces/payment.CustomerDTO/page.mdx)&#62;","description":"The customer associated with this payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extra","type":"`Record<string, unknown>`","description":"The extra fields specific to the provider session.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"config","type":"[FindConfig](../../../interfaces/payment.FindConfig/page.mdx)&#60;[PaymentMethodDTO](../../../interfaces/payment.PaymentMethodDTO/page.mdx)&#62;","description":"The configurations determining how the payment method is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a payment method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"[FindConfigOrder](../../../types/payment.FindConfigOrder/page.mdx)","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/payment.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation leveLine truncated
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[[PaymentMethodDTO](../../../interfaces/payment.PaymentMethodDTO/page.mdx)[], number]&#62;","optional":false,"defaultValue":"","description":"The list of payment methods along with their total count.","expandable":false,"children":[{"name":"PaymentMethodDTO[]","type":"[PaymentMethodDTO](../../../interfaces/payment.PaymentMethodDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"number","type":"`number`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listAndCountPaymentMethods"/>
@@ -0,0 +1,46 @@
---
displayed_sidebar: paymentReference
slug: /references/payment/listPaymentMethods
sidebar_label: listPaymentMethods
---
import { TypeList } from "docs-ui"
# listPaymentMethods - Payment Module Reference
This documentation provides a reference to the `listPaymentMethods` method. This belongs to the Payment Module.
<Note>
You should only use this methods when implementing complex customizations. For common cases, check out [available workflows instead](/medusa-workflows-reference).
</Note>
This method retrieves all payment methods based on the context and configuration.
## Example
To retrieve a list of payment methods for a customer:
```ts
const paymentMethods =
await paymentModuleService.listPaymentMethods({
provider_id: "pp_stripe_stripe",
context: {
customer: {
id: "cus_123",
metadata: {
pp_stripe_stripe_customer_id: "str_1234"
}
},
},
})
```
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterablePaymentMethodProps](../../../interfaces/payment.FilterablePaymentMethodProps/page.mdx)","description":"The filters to apply on the retrieved payment methods.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"provider_id","type":"`string`","description":"Filter the payment methods by provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[PaymentProviderContext](../../../interfaces/payment.PaymentProviderContext/page.mdx)","description":"Filter the payment methods by the context of their associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"billing_address","type":"Partial&#60;[AddressDTO](../../../types/payment.AddressDTO/page.mdx)&#62;","description":"The payment's billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The associated customer's email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"session_id","type":"`string`","description":"The ID of payment session the provider payment is associated with.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"Partial&#60;[CustomerDTO](../../../interfaces/payment.CustomerDTO/page.mdx)&#62;","description":"The customer associated with this payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extra","type":"`Record<string, unknown>`","description":"The extra fields specific to the provider session.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"config","type":"[FindConfig](../../../interfaces/payment.FindConfig/page.mdx)&#60;[PaymentMethodDTO](../../../interfaces/payment.PaymentMethodDTO/page.mdx)&#62;","description":"The configurations determining how the payment method is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a payment method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"[FindConfigOrder](../../../types/payment.FindConfigOrder/page.mdx)","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/payment.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation leveLine truncated
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PaymentMethodDTO](../../../interfaces/payment.PaymentMethodDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of payment methods.","expandable":false,"children":[{"name":"PaymentMethodDTO[]","type":"[PaymentMethodDTO](../../../interfaces/payment.PaymentMethodDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PaymentMethodDTO","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listPaymentMethods"/>
@@ -0,0 +1,11 @@
---
displayed_sidebar: paymentReference
---
import { TypeList } from "docs-ui"
# FilterablePaymentMethodProps
The filters to apply on the retrieved payment sessions.
<TypeList types={[{"name":"provider_id","type":"`string`","description":"Filter the payment methods by provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[PaymentProviderContext](../payment.PaymentProviderContext/page.mdx)","description":"Filter the payment methods by the context of their associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"billing_address","type":"Partial&#60;[AddressDTO](../../types/payment.AddressDTO/page.mdx)&#62;","description":"The payment's billing address.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"address_1","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string` \\| `null`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string` \\| `null`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string` \\| `null`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string` \\| `null`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string` \\| `null`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string` \\| `null`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| `null`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date` \\| `null`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"email","type":"`string`","description":"The associated customer's email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"session_id","type":"`string`","description":"The ID of payment session the provider payment is associated with.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"Partial&#60;[CustomerDTO](../payment.CustomerDTO/page.mdx)&#62;","description":"The customer associated with this payment.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"A flag indicating if customer has an account or not.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string`","description":"The associated default billing address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string`","description":"The associated default shipping address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"[CustomerAddressDTO](../payment.CustomerAddressDTO/page.mdx)[]","description":"The addresses of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`object`[]","description":"The groups of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},Line truncated
@@ -31,9 +31,11 @@ The main service interface for the Payment Module.
- [deleteRefundReasons](../../IPaymentModuleService/methods/payment.IPaymentModuleService.deleteRefundReasons/page.mdx)
- [getWebhookActionAndData](../../IPaymentModuleService/methods/payment.IPaymentModuleService.getWebhookActionAndData/page.mdx)
- [listAndCountPaymentCollections](../../IPaymentModuleService/methods/payment.IPaymentModuleService.listAndCountPaymentCollections/page.mdx)
- [listAndCountPaymentMethods](../../IPaymentModuleService/methods/payment.IPaymentModuleService.listAndCountPaymentMethods/page.mdx)
- [listAndCountPaymentProviders](../../IPaymentModuleService/methods/payment.IPaymentModuleService.listAndCountPaymentProviders/page.mdx)
- [listCaptures](../../IPaymentModuleService/methods/payment.IPaymentModuleService.listCaptures/page.mdx)
- [listPaymentCollections](../../IPaymentModuleService/methods/payment.IPaymentModuleService.listPaymentCollections/page.mdx)
- [listPaymentMethods](../../IPaymentModuleService/methods/payment.IPaymentModuleService.listPaymentMethods/page.mdx)
- [listPaymentProviders](../../IPaymentModuleService/methods/payment.IPaymentModuleService.listPaymentProviders/page.mdx)
- [listPayments](../../IPaymentModuleService/methods/payment.IPaymentModuleService.listPayments/page.mdx)
- [listPaymentSessions](../../IPaymentModuleService/methods/payment.IPaymentModuleService.listPaymentSessions/page.mdx)
@@ -0,0 +1,9 @@
---
displayed_sidebar: paymentReference
---
import { TypeList } from "docs-ui"
# PaymentMethodDTO
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the payment method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"The data of the payment method, as returned by the payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="PaymentMethodDTO"/>