docs: fixes following QA testing (#9690)

This commit is contained in:
Shahed Nasser
2024-10-22 18:20:21 +03:00
committed by GitHub
parent b2122c4073
commit 731309e87a
40 changed files with 70 additions and 66 deletions
@@ -309,7 +309,7 @@ curl -X POST 'localhost:9000/store/carts' \
Make sure to replace `{publishable_api_key}` with your publishable API key, which you can retrieve from the Medusa Admin. Also, replace the value of `region_id` with an ID of a region in your application.
The request will return the cart's details. You'll learn how to retrive the `custom_name` property with the cart's details in the next section.
The request will return the cart's details. You'll learn how to retrieve the `custom_name` property with the cart's details in the next section.
---
@@ -401,7 +401,7 @@ export default defineMiddlewares({
})
```
The validation schema is the similar to that of the Create Cart API route, except you can pass a `null` value for `custom_name` to remove or unset the `custom_name`'s value.
The validation schema is similar to that of the Create Cart API route, except you can pass a `null` value for `custom_name` to remove or unset the `custom_name`'s value.
### Create Workflow to Update Custom Record
@@ -617,7 +617,7 @@ return new WorkflowResponse({
})
```
Using the `when-then` utility, you check if the cart has a linked `Custom` record and `custom_name` is passed in the `additional_data`. If so, you update the linked `Custom` recod.
Using the `when-then` utility, you check if the cart has a linked `Custom` record and `custom_name` is passed in the `additional_data`. If so, you update the linked `Custom` record.
You return in the workflow response the created, updated, and deleted `Custom` record.
@@ -118,7 +118,7 @@ const shippingAdjustments =
A cart is scoped to a sales channel, region, and a customer.
The Medusa application links the Cart Module to each of their respective modules, providing with features like:
The Medusa application links the Cart Module to each of their respective modules, providing features like:
- Checking product availability in a sales channel.
- Retrieving pricing per region.
@@ -8,7 +8,7 @@ In this document, youll learn how registered and unregistered accounts are di
## `has_account` Property
The [Customer data model](/references/customer/models/Customer) has a `has_account` property, which is a boolean that indicates whether a customer is registerd.
The [Customer data model](/references/customer/models/Customer) has a `has_account` property, which is a boolean that indicates whether a customer is registered.
When a guest customer places an order, a new `Customer` record is created with `has_account` set to `false`.
@@ -321,7 +321,7 @@ curl -X POST 'localhost:9000/admin/customers' \
Make sure to replace `{token}` with an admin user's JWT token. Learn how to retrieve it in the [API reference](!api!/admin#1-bearer-authorization-with-jwt-tokens).
The request will return the customer's details. You'll learn how to retrive the `custom_name` property with the customer's details in the next section.
The request will return the customer's details. You'll learn how to retrieve the `custom_name` property with the customer's details in the next section.
---
@@ -629,7 +629,7 @@ return new WorkflowResponse({
})
```
Using the `when-then` utility, you check if the customer has a linked `Custom` record and `custom_name` is passed in the `additional_data`. If so, you update the linked `Custom` recod.
Using the `when-then` utility, you check if the customer has a linked `Custom` record and `custom_name` is passed in the `additional_data`. If so, you update the linked `Custom` record.
You return in the workflow response the created, updated, and deleted `Custom` record.
@@ -50,4 +50,4 @@ When an item in an order is returned and the associated variant has its `manage_
### Dismissed Returned Items
If a returned item is considered damanged or its dismissed, its quantity doesn't increment the `stocked_quantity` of the inventory item's level.
If a returned item is considered damaged or is dismissed, its quantity doesn't increment the `stocked_quantity` of the inventory item's level.
@@ -14,14 +14,18 @@ This is useful in many cases such as when a payment is being processed asynchron
---
## processEvent Method
## getWebhookActionAndData Method
The Payment Modules main service has a [processEvent method](/references/payment/processEvent) used to handle incoming webhook events from third-party payment services. The method delegates the handling to the associated payment provider, which returns the event's details.
The Payment Modules main service has a [getWebhookActionAndData method](/references/payment/getWebhookActionAndData) used to handle incoming webhook events from third-party payment services. The method delegates the handling to the associated payment provider, which returns the event's details.
Medusa implements a webhook listener route at the `/hooks/payment/[provider]` API route, where `[provider]` is the ID of the provider (for example, `stripe`). Use that webhook listener in your third-party payment provider's configurations.
![A diagram showcasing the steps of how the processEvent method words](https://res.cloudinary.com/dza7lstvk/image/upload/v1711567415/Medusa%20Resources/payment-webhook_seaocg.jpg)
![A diagram showcasing the steps of how the getWebhookActionAndData method words](https://res.cloudinary.com/dza7lstvk/image/upload/v1711567415/Medusa%20Resources/payment-webhook_seaocg.jpg)
If the event's details indicate that the payment should be authorized, then the [authorizePaymentSession method of the main service](/references/payment/authorizePaymentSession) is executed on the specified payment session.
If the event's details indicate that the payment should be captured, then the [capturePayment method of the main service](/references/payment/capturePayment) is executed on the payment of the specified payment session.
If the event's details indicate that the payment should be captured, then the [capturePayment method of the main service](/references/payment/capturePayment) is executed on the payment of the specified payment session.
### Actions After Webhook Payment Processing
After the payment webhook actions are processed and the payment is authorized or captured, the Medusa application completes the cart associated with the payment's collection if it's not completed yet.
@@ -327,7 +327,7 @@ curl -X POST 'localhost:9000/admin/products' \
Make sure to replace `{token}` with an admin user's JWT token. Learn how to retrieve it in the [API reference](!api!/admin#1-bearer-authorization-with-jwt-tokens).
The request will return the product's details. You'll learn how to retrive the `custom_name` property with the product's details in the next section.
The request will return the product's details. You'll learn how to retreive the `custom_name` property with the product's details in the next section.
---
@@ -635,7 +635,7 @@ return new WorkflowResponse({
})
```
Using the `when-then` utility, you check if the product has a linked `Custom` record and `custom_name` is passed in the `additional_data`. If so, you update the linked `Custom` recod.
Using the `when-then` utility, you check if the product has a linked `Custom` record and `custom_name` is passed in the `additional_data`. If so, you update the linked `Custom` record.
You return in the workflow response the created, updated, and deleted `Custom` record.
@@ -333,7 +333,7 @@ curl --location 'localhost:9000/admin/promotions' \
Make sure to replace `{token}` with an admin user's JWT token. Learn how to retrieve it in the [API reference](!api!/admin#1-bearer-authorization-with-jwt-tokens).
The request will return the promotion's details. You'll learn how to retrive the `custom_name` property with the promotion's details in the next section.
The request will return the promotion's details. You'll learn how to retrieve the `custom_name` property with the promotion's details in the next section.
---
@@ -641,7 +641,7 @@ return new WorkflowResponse({
})
```
Using the `when-then` utility, you check if the promotion has a linked `Custom` record and `custom_name` is passed in the `additional_data`. If so, you update the linked `Custom` recod.
Using the `when-then` utility, you check if the promotion has a linked `Custom` record and `custom_name` is passed in the `additional_data`. If so, you update the linked `Custom` record.
You return in the workflow response the created, updated, and deleted `Custom` record.