Order Processing & Invoicing
Relevant source files
The following files were used as context for generating this wiki page:
Order Processing and Invoicing manages the transition of customer selections into formal commercial transactions. The system validates order data, tracks payment status, and generates legal documentation for delivery and payment verification.
This module ensures that every order adheres to domain constraints, such as maximum message lengths and valid cart states. It integrates with payment services and shipping providers to facilitate the physical fulfillment of goods.
Sources: README.md
Core Components and Data Structures
Order Domain Constraints
The system enforces specific limits on order-related data to ensure database integrity and user interface consistency. These constraints primarily target communication between the merchant and the customer.
| Constant | Value | Description |
|---|---|---|
MAX_ORDER_MESSAGE_LENGTH | 1200 | Maximum characters allowed for a private or customer order message. |
Sources: src/Core/Domain/Order/OrderConstraints.php:25-27
Cart Status Verification
Before an order is finalized, the system verifies the status of the underlying cart. A cart must be in a non-abandoned state to proceed through the checkout flow.
The diagram above shows the validation gate where cart status determines if order processing continues.
Sources: src/Core/Domain/Cart/CartStatus.php:25-35
Fulfillment and Legal Requirements
Delivery and Shipping Terms
Order processing includes the calculation of shipping fees and the selection of carriers. The system handles package dispatch workflows and tracking integration.
- Dispatch Time: Packages generally ship within 2 days after payment receipt.
- Tracking: The system provides online tracking links for UPS and other carriers.
- Shipping Fees: Calculations include handling, packing, and postage based on total shipment weight.
- Consolidation: The system treats distinct orders separately; it does not automatically group them for shipping fee reductions.
Sources: install-dev/langs/en/data/cms.xml:3-10
Secure Payment Integration
Orders transition to a "Paid" status only after successful verification through secure payment gateways.
- Supported Methods: Visa, Mastercard, and PayPal.
- Security: Transactions utilize SSL encryption for data protection.
- Payment Receipt: The system triggers dispatch logic only after the payment is confirmed.
Sources: install-dev/langs/en/data/cms.xml:38-45, README.md
Order Object Management
The Order class serves as the primary data model for persistent order information. It encapsulates the financial totals, tax information, and relationship to the customer and cart.
Key Data Fields
| Field | Type | Description |
|---|---|---|
id_cart | int | Unique identifier for the source cart. |
id_customer | int | Unique identifier for the purchasing customer. |
total_paid | decimal | Total amount paid by the customer including taxes and shipping. |
invoice_number | int | Legal identifier generated upon successful payment. |
delivery_number | int | Identifier generated when the shipping slip is created. |
Sources: classes/order/Order.php
Sequence of Order Generation
The following sequence diagram illustrates the interaction between the Cart and Order domains during finalization.
This diagram illustrates the flow from cart validation to final invoice generation.
Sources: src/Core/Domain/Order/OrderConstraints.php, classes/order/Order.php, install-dev/langs/en/data/cms.xml
Summary
Order Processing & Invoicing converts carts into orders by enforcing domain constraints and validating payment status. It handles the generation of shipping details and legal notices required for e-commerce compliance. By centralizing validation in OrderConstraints and status tracking in CartStatus, the system maintains data integrity across the transaction lifecycle.