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

* added tsdocs for payment processor

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,231 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# PaymentProcessorContext
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": []
}
]} />

View File

@@ -0,0 +1,41 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# PaymentProcessorError
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": []
}
]} />

View File

@@ -0,0 +1,51 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# PaymentProcessorSessionResponse
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": []
}
]} />