chore: reorganize docs apps (#7228)

* reorganize docs apps

* add README

* fix directory

* add condition for old docs
This commit is contained in:
Shahed Nasser
2024-05-03 17:36:38 +03:00
committed by GitHub
parent 224ebb2154
commit 4fe28f5a95
6187 changed files with 601447 additions and 598226 deletions
@@ -0,0 +1,79 @@
import { Table } from "docs-ui"
export const metadata = {
title: `Transactions`,
}
# {metadata.title}
In this document, youll learn about an orders transactions and usefulness.
## 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.
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:
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Condition</Table.HeaderCell>
<Table.HeaderCell>Result</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
summarys total - transaction amounts total = 0
</Table.Cell>
<Table.Cell>
Theres no outstanding amount.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
summarys total - transaction amounts total > 0
</Table.Cell>
<Table.Cell>
The customer owes additional payment to the merchant.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
summarys total - transaction amounts total < 0
</Table.Cell>
<Table.Cell>
The merchant owes the customer a refund.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>