docs: update override price selection strategy documentation (#5438)
* docs: update override price selection strategy documentation * fix eslint errors
This commit is contained in:
1 parent
8bc902fb0f
commit
1a10822cae
540 files changed
+244366
-18865
No files matched your search
+3
-3
@@ -262,7 +262,7 @@ It accepts four parameters:
|
||||
1. If the resource the fulfillment is being created for is a claim, the `is_claim` property in the object will be `true`.
|
||||
2. If the resource the fulfillment is being created for is a swap, the `is_swap` property in the object will be `true`.
|
||||
3. Otherwise, the resource is an order.
|
||||
4. The fourth parameter is an object of type [Fulfillment](../../../references/entities/classes/Fulfillment.md), which is the fulfillment being created.
|
||||
4. The fourth parameter is an object of type [Fulfillment](../../../references/entities/classes/Fulfillment.mdx), which is the fulfillment being created.
|
||||
|
||||
You can use the `data` property in the shipping method (first parameter) to access the data specific to the shipping option. This is based on your implementation of previous methods.
|
||||
|
||||
@@ -328,7 +328,7 @@ This method receives three parameters:
|
||||
1. If the price is being calculated for the list of shipping options available for a cart, it's the `data` object of the shipping option.
|
||||
2. If the price is being calculated when the shipping method is being created, it's the data returned by the [validateFulfillmentData](#validatefulfillmentdata) method used during the shipping method creation.
|
||||
3. If the price is being calculated while calculating the cart's totals, it will be the `data` object of the cart's shipping method.
|
||||
3. The third parameter is either the [Cart](../../../references/entities/classes/Cart.md) or the [Order](../../../references/entities/classes/Order.md) object.
|
||||
3. The third parameter is either the [Cart](../../../references/entities/classes/Cart.mdx) or the [Order](../../../references/entities/classes/Order.mdx) object.
|
||||
|
||||
The method is expected to return a number that will be used to set the price of the shipping method or option, based on the context it's used in.
|
||||
|
||||
@@ -368,7 +368,7 @@ Fulfillment providers can also be used to return products. A shipping option can
|
||||
|
||||
This method is used when the admin [creates a return request](https://docs.medusajs.com/api/admin#orders_postordersorderreturns) for an order, [creates a swap](https://docs.medusajs.com/api/admin#orders_postordersorderswaps) for an order, or when the customer [creates a return of their order](https://docs.medusajs.com/api/store#returns_postreturns). The fulfillment is created automatically for the order return.
|
||||
|
||||
The method receives as a parameter the [Return](../../../references/entities/classes/Return.md) object, which is the return that the fulfillment is being created for.
|
||||
The method receives as a parameter the [Return](../../../references/entities/classes/Return.mdx) object, which is the return that the fulfillment is being created for.
|
||||
|
||||
The method must return an object that will be used to set the value of the `shipping_data` attribute of the return being created.
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class MyPaymentProcessor extends AbstractPaymentProcessor {
|
||||
Record<string, unknown> |
|
||||
PaymentProcessorError
|
||||
> {
|
||||
throw new Error("Method not implemented.");
|
||||
throw new Error("Method not implemented.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ An example of a minimal implementation of `updatePaymentData` that returns the `
|
||||
|
||||
```ts
|
||||
import {
|
||||
PaymentProcessorError
|
||||
PaymentProcessorError,
|
||||
} from "@medusajs/medusa"
|
||||
// ...
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ A cart is represented by the `Cart` entity. Some of the `Cart` entity’s attrib
|
||||
- `completed_at`: the date the cart was completed. A completed cart means that it has been used for its main purpose. For example, if the cart is used to place an order, then a completed cart means that the order was placed.
|
||||
- `payment_authorized_at`: the date a payment was authorized.
|
||||
|
||||
There are other important attributes discussed in later sections. Check out the [full Cart entity in the entities reference](../../references/entities/classes/Cart.md).
|
||||
There are other important attributes discussed in later sections. Check out the [full Cart entity in the entities reference](../../references/entities/classes/Cart.mdx).
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ It’s important to enable a payment processor in a region, or else the payment
|
||||
|
||||
### PaymentProvider Entity Overview
|
||||
|
||||
The [`PaymentProvider`](../../references/entities/classes/PaymentProvider.md) entity only has 2 attributes: `is_installed` which is a boolean value indicating whether the Payment Processor is installed; and `id` which is the unique identifier that you define in the Payment Processor service.
|
||||
The [`PaymentProvider`](../../references/entities/classes/PaymentProvider.mdx) entity only has 2 attributes: `is_installed` which is a boolean value indicating whether the Payment Processor is installed; and `id` which is the unique identifier that you define in the Payment Processor service.
|
||||
|
||||
---
|
||||
|
||||
@@ -82,7 +82,7 @@ Among the Payment Sessions available only one will be selected based on the cust
|
||||
|
||||
### PaymentSession Entity Overview
|
||||
|
||||
The [`PaymentSession`](../../references/entities/classes/PaymentSession.md) entity belongs to a `Cart`. This is the customer‘s cart that was used for checkout which lead to the creation of the Payment Session.
|
||||
The [`PaymentSession`](../../references/entities/classes/PaymentSession.mdx) entity belongs to a `Cart`. This is the customer‘s cart that was used for checkout which lead to the creation of the Payment Session.
|
||||
|
||||
The `PaymentSession` instance also belongs to a `PaymentProvider` instance. This is the Payment Processor that was used to create the Payment Session and that controls it for further actions like authorizing the payment.
|
||||
|
||||
@@ -116,7 +116,7 @@ When the store operator then chooses to capture the order from the Medusa Admin,
|
||||
|
||||
### Payment Entity Overview
|
||||
|
||||
The [`Payment`](../../references/entities/classes/Payment.md) entity belongs to the `Cart` that it was originally created from when the customer’s payment was authorized. It also belongs to an `Order` once it’s placed. Additionally, it belongs to a `PaymentProvider` which is the payment processor that the customer chose on checkout.
|
||||
The [`Payment`](../../references/entities/classes/Payment.mdx) entity belongs to the `Cart` that it was originally created from when the customer’s payment was authorized. It also belongs to an `Order` once it’s placed. Additionally, it belongs to a `PaymentProvider` which is the payment processor that the customer chose on checkout.
|
||||
|
||||
In case a `Swap` is created for an order, `Payment` will be associated with that swap to handle payment operations related to it.
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ Once the Fulfillment Provider is added to the backend, the store operator will b
|
||||
|
||||
### FulfillmentProvider Entity Overview
|
||||
|
||||
The [`FulfillmentProvider`](../../references/entities/classes/FulfillmentProvider.md) entity only has 2 attributes: `is_installed` to indicate if the fulfillment provider is installed and its value is a boolean; and `id` which is the unique identifier that you define in the Fulfillment Provider Service.
|
||||
The [`FulfillmentProvider`](../../references/entities/classes/FulfillmentProvider.mdx) entity only has 2 attributes: `is_installed` to indicate if the fulfillment provider is installed and its value is a boolean; and `id` which is the unique identifier that you define in the Fulfillment Provider Service.
|
||||
|
||||
---
|
||||
|
||||
@@ -73,7 +73,7 @@ For example, shipping heavy items might be more expensive than others, which wou
|
||||
|
||||
### ShippingProfile Entity Overview
|
||||
|
||||
The [`ShippingProfile`](../../references/entities/classes/ShippingProfile.md) entity can have a set of `Product` instances. These would be the products the shipping profile is providing shipping options for.
|
||||
The [`ShippingProfile`](../../references/entities/classes/ShippingProfile.mdx) entity can have a set of `Product` instances. These would be the products the shipping profile is providing shipping options for.
|
||||
|
||||
The `ShippingProfile` has a `type` attribute that can be `default`, `gift_card`, or `custom`.
|
||||
|
||||
@@ -101,7 +101,7 @@ Think of a shipping option as a template defined by the admin that indicates wha
|
||||
|
||||
### ShippingOption Entity Overview
|
||||
|
||||
The [`ShippingOption`](../../references/entities/classes/ShippingOption.md) entity belongs to the `ShippingProfile` entity.
|
||||
The [`ShippingOption`](../../references/entities/classes/ShippingOption.mdx) entity belongs to the `ShippingProfile` entity.
|
||||
|
||||
The `ShippingOption` entity also belongs to a `FulfillmentProvider`. This can be either a custom third-party provider or one of Medusa’s default fulfillment providers.
|
||||
|
||||
@@ -139,7 +139,7 @@ This separation allows for developers to implement the custom integration with t
|
||||
|
||||
A lot of the shipping method’s attributes are similar to the shipping option’s attribute.
|
||||
|
||||
The [`ShippingMethod`](../../references/entities/classes/ShippingMethod.md) entity belongs to a `ShippingOption`.
|
||||
The [`ShippingMethod`](../../references/entities/classes/ShippingMethod.mdx) entity belongs to a `ShippingOption`.
|
||||
|
||||
Similar to the `data` attribute explained for the `ShippingOption` entity, a `ShippingMethod` has a similar `data` attribute that includes all the data to be sent to the fulfillment provider when fulfilling the order.
|
||||
|
||||
|
||||
Reference in new issue
Block a user