docs: edits and fixes to commerce module docs (#7468)

Apply edits and fixes to the commerce modules docs
This commit is contained in:
Shahed Nasser
2024-05-29 11:08:06 +00:00
committed by GitHub
parent 130de74d6d
commit 2c5ba408d4
160 changed files with 6400 additions and 3790 deletions
@@ -6,30 +6,19 @@ export const metadata = {
# {metadata.title}
In this document, youll learn about an orders transactions and usefulness.
In this document, youll learn about an orders transactions and its use.
## What is a Transaction?
A transaction represents any order payment process, such as capturing or refunding an amount. Its represented by the `Transaction` data model.
A transaction represents any order payment process, such as capturing or refunding an amount. Its represented by the [Transaction data model](/references/order/models/Transaction).
The transactions main purpose is to ensure a correct balance between paid and outstanding amounts.
---
## Transaction Reference
The Order Module doesnt provide payment processing functionalities, so it doesnt store payments that can be processed. For that, use the Payment Module or custom logic.
The `Transaction` data model has two fields that determine which data model and record holds the actual payments details:
- `reference`: indicates the tables name in the database. For example, `payment` if youre using the Payment Module.
- `reference_id`: indicates the ID of the record in the table. For example, `pay_123`.
---
## Checking Outstanding Amount
The orders total is stored in the `OrderSummary`'s `total` field. To check the outstanding amount of the order, the transaction amounts of an order are summed. Then:
The orders total is stored in the `OrderSummary`'s `total` field. To check the outstanding amount of the order, its transaction amounts are summed. Then, the following conditions are checked:
<Table>
<Table.Header>
@@ -77,3 +66,14 @@ The orders total is stored in the `OrderSummary`'s `total` field. To check th
</Table.Row>
</Table.Body>
</Table>
---
## Transaction Reference
The Order Module doesnt provide payment processing functionalities, so it doesnt store payments that can be processed. For that, use the Payment Module or custom logic.
The `Transaction` data model has two fields that determine which data model and record holds the actual payments details:
- `reference`: indicates the tables name in the database. For example, `payment` if youre using the Payment Module.
- `reference_id`: indicates the ID of the record in the table. For example, `pay_123`.