docs: prep for v2 documentation (#6710)

This PR includes documentation that preps for v2 docs (but doesn't introduce new docs).

_Note: The number of file changes in the PR is due to find-and-replace within the `references` which is unavoidable. Let me know if I should move it to another PR._

## Changes

- Change Medusa version in base OAS used for v2.
- Fix to docblock generator related to not catching all path parameters.
- Added typedoc plugin that generates ER Diagrams, which will be used specifically for data model references in commerce modules.
- Changed OAS tool to output references in `www/apps/api-reference/specs-v2` directory when the `--v2` option is used.
- Added a version switcher to the API reference to switch between V1 and V2. This switcher is enabled by an environment variable, so it won't be visible/usable at the moment.
- Upgraded docusaurus to v3.0.1
- Added new Vale rules to ensure correct spelling of Medusa Admin and module names.
- Added new components to the `docs-ui` package that will be used in future documentation changes.
This commit is contained in:
Shahed Nasser
2024-03-18 07:47:35 +00:00
committed by GitHub
parent 56a6ec0227
commit bb87db8342
2008 changed files with 15716 additions and 10536 deletions
@@ -2,7 +2,7 @@
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
import TypeList from "@site/src/components/TypeList"
# PaymentProcessor
@@ -145,11 +145,11 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"context","type":"[PaymentProcessorContext](payment.PaymentProcessorContext.mdx)","description":"The context of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"email","type":"`string`","description":"The customer's email.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The selected currency code, typically associated with the customer's cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string`","description":"The ID of the resource the payment is associated with. For example, the cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The cart's context.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"If the payment session hasn't been created or initiated yet, it'll be an empty object.\nIf the payment session exists, it'll be the value of the payment session's `data` field.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`null` \\| [Address](../../entities/classes/entities.Address.mdx)","description":"The payment's billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"[Customer](../../entities/classes/entities.Customer.mdx)","description":"The customer associated with this payment.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="initiatePayment"/>
<TypeList types={[{"name":"context","type":"[PaymentProcessorContext](payment.PaymentProcessorContext.mdx)","description":"The context of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"email","type":"`string`","description":"The customer's email.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The selected currency code, typically associated with the customer's cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string`","description":"The ID of the resource the payment is associated with. For example, the cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The cart's context.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"If the payment session hasn't been created or initiated yet, it'll be an empty object.\nIf the payment session exists, it'll be the value of the payment session's `data` field.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`null` \\| [Address](../../entities/classes/entities.Address.mdx)","description":"The payment's billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"[Customer](../../entities/classes/entities.Customer.mdx)","description":"The customer associated with this payment.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="initiatePayment"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| [PaymentProcessorSessionResponse](payment.PaymentProcessorSessionResponse.mdx)&#62;","optional":false,"defaultValue":"","description":"Either the payment's data or an error object.","expandable":false,"children":[{"name":"PaymentProcessorError \\| PaymentProcessorSessionResponse","type":"[PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| [PaymentProcessorSessionResponse](payment.PaymentProcessorSessionResponse.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="initiatePayment"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| [PaymentProcessorSessionResponse](payment.PaymentProcessorSessionResponse.mdx)&#62;","optional":false,"defaultValue":"","description":"Either the payment's data or an error object.","expandable":false,"children":[{"name":"PaymentProcessorError \\| PaymentProcessorSessionResponse","type":"[PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| [PaymentProcessorSessionResponse](payment.PaymentProcessorSessionResponse.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="initiatePayment"/>
### updatePayment
@@ -192,11 +192,11 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"context","type":"[PaymentProcessorContext](payment.PaymentProcessorContext.mdx)","description":"The context of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"email","type":"`string`","description":"The customer's email.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The selected currency code, typically associated with the customer's cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string`","description":"The ID of the resource the payment is associated with. For example, the cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The cart's context.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"If the payment session hasn't been created or initiated yet, it'll be an empty object.\nIf the payment session exists, it'll be the value of the payment session's `data` field.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`null` \\| [Address](../../entities/classes/entities.Address.mdx)","description":"The payment's billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"[Customer](../../entities/classes/entities.Customer.mdx)","description":"The customer associated with this payment.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePayment"/>
<TypeList types={[{"name":"context","type":"[PaymentProcessorContext](payment.PaymentProcessorContext.mdx)","description":"The context of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"email","type":"`string`","description":"The customer's email.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The selected currency code, typically associated with the customer's cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string`","description":"The ID of the resource the payment is associated with. For example, the cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The cart's context.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"If the payment session hasn't been created or initiated yet, it'll be an empty object.\nIf the payment session exists, it'll be the value of the payment session's `data` field.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`null` \\| [Address](../../entities/classes/entities.Address.mdx)","description":"The payment's billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"[Customer](../../entities/classes/entities.Customer.mdx)","description":"The customer associated with this payment.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updatePayment"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;void \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| [PaymentProcessorSessionResponse](payment.PaymentProcessorSessionResponse.mdx)&#62;","optional":false,"defaultValue":"","description":"Either the payment's data or an error object.","expandable":false,"children":[{"name":"void \\| PaymentProcessorError \\| PaymentProcessorSessionResponse","type":"`void` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| [PaymentProcessorSessionResponse](payment.PaymentProcessorSessionResponse.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="updatePayment"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;void \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| [PaymentProcessorSessionResponse](payment.PaymentProcessorSessionResponse.mdx)&#62;","optional":false,"defaultValue":"","description":"Either the payment's data or an error object.","expandable":false,"children":[{"name":"void \\| PaymentProcessorError \\| PaymentProcessorSessionResponse","type":"`void` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| [PaymentProcessorSessionResponse](payment.PaymentProcessorSessionResponse.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="updatePayment"/>
### refundPayment
@@ -237,11 +237,11 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of a Payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"refundAmount","type":"`number`","description":"the amount to refund.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="refundPayment"/>
<TypeList types={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of a Payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"refundAmount","type":"`number`","description":"the amount to refund.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="refundPayment"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"Either an error object or a value that's stored in the `data` field of the Payment.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="refundPayment"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"Either an error object or a value that's stored in the `data` field of the Payment.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="refundPayment"/>
### authorizePayment
@@ -306,11 +306,11 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the payment session.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The context of the authorization. It may include some of the following fields:\n\n- `ip`: The customers IP.\n- `idempotency_key`: The [Idempotency Key](https://docs.medusajs.com/modules/carts-and-checkout/payment#idempotency-key) that is associated with the current cart. It is useful when retrying payments, retrying checkout at a failed point, or for payments that require additional actions from the customer.\n- `cart_id`: The ID of a cart. This is only during operations like placing an order or creating a swap.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="authorizePayment"/>
<TypeList types={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the payment session.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The context of the authorization. It may include some of the following fields:\n\n- `ip`: The customers IP.\n- `idempotency_key`: The [Idempotency Key](https://docs.medusajs.com/modules/carts-and-checkout/payment#idempotency-key) that is associated with the current cart. It is useful when retrying payments, retrying checkout at a failed point, or for payments that require additional actions from the customer.\n- `cart_id`: The ID of a cart. This is only during operations like placing an order or creating a swap.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="authorizePayment"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| object&#62;","optional":false,"defaultValue":"","description":"The authorization details or an error object.","expandable":false,"children":[{"name":"PaymentProcessorError \\| object","type":"[PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="authorizePayment"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| object&#62;","optional":false,"defaultValue":"","description":"The authorization details or an error object.","expandable":false,"children":[{"name":"PaymentProcessorError \\| object","type":"[PaymentProcessorError](payment.PaymentProcessorError.mdx) \\| `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="authorizePayment"/>
### capturePayment
@@ -350,11 +350,11 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the Payment for its first parameter.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="capturePayment"/>
<TypeList types={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the Payment for its first parameter.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="capturePayment"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"Either an error object or a value that's stored in the `data` field of the Payment.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="capturePayment"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"Either an error object or a value that's stored in the `data` field of the Payment.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="capturePayment"/>
### deletePayment
@@ -391,11 +391,11 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the Payment Session.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="deletePayment"/>
<TypeList types={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the Payment Session.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="deletePayment"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"Either an error object or an empty object.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="deletePayment"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"Either an error object or an empty object.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="deletePayment"/>
### retrievePayment
@@ -427,11 +427,11 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of a Payment Session. Make sure to store in the `data` field any necessary data that would allow you to retrieve the payment data from the third-party provider.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="retrievePayment"/>
<TypeList types={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of a Payment Session. Make sure to store in the `data` field any necessary data that would allow you to retrieve the payment data from the third-party provider.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="retrievePayment"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"The payment's data, typically retrieved from a third-party provider.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="retrievePayment"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"The payment's data, typically retrieved from a third-party provider.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="retrievePayment"/>
### cancelPayment
@@ -473,11 +473,11 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the Payment.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="cancelPayment"/>
<TypeList types={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the Payment.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="cancelPayment"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"Either an error object or a value that's stored in the `data` field of the Payment.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="cancelPayment"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"Either an error object or a value that's stored in the `data` field of the Payment.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="cancelPayment"/>
### getPaymentStatus
@@ -509,11 +509,11 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of a Payment as a parameter. You can use this data to interact with the third-party provider to check the status of the payment if necessary.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="getPaymentStatus"/>
<TypeList types={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of a Payment as a parameter. You can use this data to interact with the third-party provider to check the status of the payment if necessary.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="getPaymentStatus"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;[PaymentSessionStatus](../../entities/enums/entities.PaymentSessionStatus.mdx)&#62;","optional":false,"defaultValue":"","description":"The status of the Payment or Payment Session.","expandable":false,"children":[{"name":"PaymentSessionStatus","type":"`object`","description":"The status of a payment session.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="getPaymentStatus"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PaymentSessionStatus](../../entities/enums/entities.PaymentSessionStatus.mdx)&#62;","optional":false,"defaultValue":"","description":"The status of the Payment or Payment Session.","expandable":false,"children":[{"name":"PaymentSessionStatus","type":"`object`","description":"The status of a payment session.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="getPaymentStatus"/>
### updatePaymentData
@@ -562,8 +562,8 @@ class MyPaymentService extends AbstractPaymentProcessor {
#### Parameters
<ParameterTypes parameters={[{"name":"sessionId","type":"`string`","description":"The ID of the payment session.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"The data to be updated in the payment session.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="updatePaymentData"/>
<TypeList types={[{"name":"sessionId","type":"`string`","description":"The ID of the payment session.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"The data to be updated in the payment session.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="updatePaymentData"/>
#### Returns
<ParameterTypes parameters={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"the data to store in the `data` field of the payment session.\nYou can keep the data as-is, or make changes to it by communicating with the third-party provider.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="updatePaymentData"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;Record&#60;string, unknown&#62; \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)&#62;","optional":false,"defaultValue":"","description":"the data to store in the `data` field of the payment session.\nYou can keep the data as-is, or make changes to it by communicating with the third-party provider.","expandable":false,"children":[{"name":"Record&#60;string, unknown&#62; \\| PaymentProcessorError","type":"`Record<string, unknown>` \\| [PaymentProcessorError](payment.PaymentProcessorError.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="updatePaymentData"/>
@@ -2,7 +2,7 @@
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
import TypeList from "@site/src/components/TypeList"
# PaymentProcessorContext
@@ -10,4 +10,4 @@ A payment's context.
## Properties
<ParameterTypes parameters={[{"name":"email","type":"`string`","description":"The customer's email.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The selected currency code, typically associated with the customer's cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string`","description":"The ID of the resource the payment is associated with. For example, the cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The cart's context.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"If the payment session hasn't been created or initiated yet, it'll be an empty object.\nIf the payment session exists, it'll be the value of the payment session's `data` field.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`null` \\| [Address](../../entities/classes/entities.Address.mdx)","description":"The payment's billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"[Customer](../../entities/classes/entities.Customer.mdx)","description":"The customer associated with this payment.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The customer's ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date with timezone at which the resource was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"The date with timezone at which the resource was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"The date with timezone at which the resource was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The customer's email","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The customer's first name","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The customer's last name","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address_id","type":"`null` \\| `string`","description":"The customer's billing address ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"[Address](../../entities/classes/entities.Address.mdx)","description":"The details of the billing address associated with the customer.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"shipping_addresses","type":"[Address](../../entities/classes/entities.Address.mdx)[]","description":"The details of the shipping addresses associated with the customer.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"password_hash","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The customer's phone number","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"Whether the customer has an account or not","optional":false,"defaultValue":"false","expandable":false,"children":[]},{"name":"orders","type":"[Order](../../entities/classes/entities.Order.mdx)[]","description":"The details of the orders this customer placed.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"groups","type":"[CustomerGroup](../../entities/classes/entities.CustomerGroup.mdx)[]","description":"The customer groups the customer belongs to.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"An optional key-value map with additional details","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="PaymentProcessorContext"/>
<TypeList types={[{"name":"email","type":"`string`","description":"The customer's email.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The selected currency code, typically associated with the customer's cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string`","description":"The ID of the resource the payment is associated with. For example, the cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The cart's context.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"If the payment session hasn't been created or initiated yet, it'll be an empty object.\nIf the payment session exists, it'll be the value of the payment session's `data` field.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`null` \\| [Address](../../entities/classes/entities.Address.mdx)","description":"The payment's billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"[Customer](../../entities/classes/entities.Customer.mdx)","description":"The customer associated with this payment.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The customer's ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date with timezone at which the resource was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"The date with timezone at which the resource was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"The date with timezone at which the resource was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The customer's email","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The customer's first name","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The customer's last name","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address_id","type":"`null` \\| `string`","description":"The customer's billing address ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"[Address](../../entities/classes/entities.Address.mdx)","description":"The details of the billing address associated with the customer.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"shipping_addresses","type":"[Address](../../entities/classes/entities.Address.mdx)[]","description":"The details of the shipping addresses associated with the customer.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"password_hash","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The customer's phone number","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"Whether the customer has an account or not","optional":false,"defaultValue":"false","expandable":false,"children":[]},{"name":"orders","type":"[Order](../../entities/classes/entities.Order.mdx)[]","description":"The details of the orders this customer placed.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"groups","type":"[CustomerGroup](../../entities/classes/entities.CustomerGroup.mdx)[]","description":"The customer groups the customer belongs to.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"An optional key-value map with additional details","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="PaymentProcessorContext"/>
@@ -2,7 +2,7 @@
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
import TypeList from "@site/src/components/TypeList"
# PaymentProcessorError
@@ -10,4 +10,4 @@ An object that is returned in case of an error.
## Properties
<ParameterTypes parameters={[{"name":"error","type":"`string`","description":"The error message","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The error code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"detail","type":"`any`","description":"Any additional helpful details.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="PaymentProcessorError"/>
<TypeList types={[{"name":"error","type":"`string`","description":"The error message","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The error code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"detail","type":"`any`","description":"Any additional helpful details.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="PaymentProcessorError"/>
@@ -2,7 +2,7 @@
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
import TypeList from "@site/src/components/TypeList"
# PaymentProcessorSessionResponse
@@ -10,4 +10,4 @@ The response of operations on a payment.
## Properties
<ParameterTypes parameters={[{"name":"session_data","type":"`Record<string, unknown>`","description":"The data to be stored in the `data` field of the Payment Session to be created.\nThe `data` field is useful to hold any data required by the third-party provider to process the payment or retrieve its details at a later point.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"update_requests","type":"`object`","description":"Used to specify data that should be updated in the Medusa backend.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_metadata","type":"`Record<string, unknown>`","description":"Specifies a new value of the `metadata` field of the customer associated with the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update_requests.customer_metadata","type":"`Record<string, unknown>`","description":"Specifies a new value of the `metadata` field of the customer associated with the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="PaymentProcessorSessionResponse"/>
<TypeList types={[{"name":"session_data","type":"`Record<string, unknown>`","description":"The data to be stored in the `data` field of the Payment Session to be created.\nThe `data` field is useful to hold any data required by the third-party provider to process the payment or retrieve its details at a later point.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"update_requests","type":"`object`","description":"Used to specify data that should be updated in the Medusa backend.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_metadata","type":"`Record<string, unknown>`","description":"Specifies a new value of the `metadata` field of the customer associated with the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update_requests.customer_metadata","type":"`Record<string, unknown>`","description":"Specifies a new value of the `metadata` field of the customer associated with the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="PaymentProcessorSessionResponse"/>