docs: generate medusa-react reference (#6004)

* add new plugin for better organization

* added handling in theme for mutations and query types

* added tsdoc to hooks

* added tsdocs to utility functions

* added tsdoc to providers

* generated reference

* general fixes for generated reference

* generated api reference specs + general fixes

* add missing import react

* split utilities into different directories

* added overview page

* added link to customer authentication section

* fix lint errors

* added changeset

* fix readme

* fixed build error

* added expand fields + other sections to overview

* updated what's new section

* general refactoring

* remove unnecessary query field

* fix links

* added ignoreApi option
This commit is contained in:
Shahed Nasser
2024-01-05 17:03:38 +02:00
committed by GitHub
parent 6fc6a9de6a
commit 7d650771d1
2811 changed files with 231856 additions and 455063 deletions
@@ -170,50 +170,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": []
}
]} />
<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":[]}]} />
#### 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": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
___
@@ -257,41 +218,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": []
}
]} />
<ParameterTypes parameters={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the Payment.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} />
#### 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": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
___
@@ -333,41 +264,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": []
}
]} />
<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":[]}]} />
#### 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": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
___
@@ -406,41 +307,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": []
}
]} />
<ParameterTypes parameters={[{"name":"paymentSessionData","type":"`Record<string, unknown>`","description":"The `data` field of the Payment Session.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} />
#### 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": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
___
@@ -474,41 +345,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": []
}
]} />
<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":[]}]} />
#### 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": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
___
@@ -550,114 +391,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": "amount",
"type": "`number`",
"description": "The payment's amount.",
"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": "context",
"type": "`Record<string, unknown>`",
"description": "The cart's context.",
"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": "customer",
"type": "[Customer](../../entities/classes/entities.Customer.mdx)",
"description": "The customer associated with this payment.",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "email",
"type": "`string`",
"description": "The customer's email.",
"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": "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": []
}
]
}
]} />
<ParameterTypes parameters={[{"name":"context","type":"[PaymentProcessorContext](payment.PaymentProcessorContext.mdx)","description":"The context of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"`number`","description":"The payment's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The cart's context.","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":"email","type":"`string`","description":"The customer's email.","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":"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":"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":[]}]}]} />
#### 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": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
___
@@ -700,50 +438,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": []
}
]} />
<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":[]}]} />
#### 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": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
___
@@ -777,41 +476,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": []
}
]} />
<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":[]}]} />
#### 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": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
___
@@ -856,114 +525,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": "amount",
"type": "`number`",
"description": "The payment's amount.",
"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": "context",
"type": "`Record<string, unknown>`",
"description": "The cart's context.",
"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": "customer",
"type": "[Customer](../../entities/classes/entities.Customer.mdx)",
"description": "The customer associated with this payment.",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "email",
"type": "`string`",
"description": "The customer's email.",
"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": "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": []
}
]
}
]} />
<ParameterTypes parameters={[{"name":"context","type":"[PaymentProcessorContext](payment.PaymentProcessorContext.mdx)","description":"The context of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"`number`","description":"The payment's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The cart's context.","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":"email","type":"`string`","description":"The customer's email.","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":"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":"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":[]}]}]} />
#### 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": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
___
@@ -1014,47 +580,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": []
}
]} />
<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":[]}]} />
#### 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": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]
}
]} />
<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":[]}]}]} />
@@ -10,222 +10,4 @@ A payment's context.
## Properties
<ParameterTypes parameters={[
{
"name": "amount",
"type": "`number`",
"description": "The payment's amount.",
"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": "context",
"type": "`Record<string, unknown>`",
"description": "The cart's context.",
"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": "customer",
"type": "[Customer](../../entities/classes/entities.Customer.mdx)",
"description": "The customer associated with this payment.",
"optional": true,
"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": "billing_address_id",
"type": "`null` \\| `string`",
"description": "The customer's billing address 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": "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": "groups",
"type": "[CustomerGroup](../../entities/classes/entities.CustomerGroup.mdx)[]",
"description": "The customer groups the customer belongs to.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "has_account",
"type": "`boolean`",
"description": "Whether the customer has an account or not",
"optional": false,
"defaultValue": "false",
"expandable": false,
"children": []
},
{
"name": "id",
"type": "`string`",
"description": "The customer's ID",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "last_name",
"type": "`string`",
"description": "The customer's last name",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "metadata",
"type": "`Record<string, unknown>`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
"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": "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": "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": "updated_at",
"type": "`Date`",
"description": "The date with timezone at which the resource was updated.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]
},
{
"name": "email",
"type": "`string`",
"description": "The customer's email.",
"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": "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": []
}
]} />
<ParameterTypes parameters={[{"name":"amount","type":"`number`","description":"The payment's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`Record<string, unknown>`","description":"The cart's context.","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":"email","type":"`string`","description":"The customer's email.","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":"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":"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":"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":"billing_address_id","type":"`null` \\| `string`","description":"The customer's billing address 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":"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":"groups","type":"[CustomerGroup](../../entities/classes/entities.CustomerGroup.mdx)[]","description":"The customer groups the customer belongs to.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"has_account","type":"`boolean`","description":"Whether the customer has an account or not","optional":false,"defaultValue":"false","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The customer's ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The customer's last name","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"An optional key-value map with additional details","optional":false,"defaultValue":"","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":"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":"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":"updated_at","type":"`Date`","description":"The date with timezone at which the resource was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} />
@@ -10,32 +10,4 @@ An object that is returned in case of an error.
## Properties
<ParameterTypes parameters={[
{
"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": []
},
{
"name": "error",
"type": "`string`",
"description": "The error message",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
<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":[]}]} />
@@ -10,42 +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": []
}
]} />
<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":[]}]} />