Skip to content

Payment & Transaction Phase A In-progress

Connects the merchant's payment providers to BANA and turns completed payments into money the merchant can track. It spans two backend services: Payment (provider credentials + webhook/event dispatch) and Finance (double-entry wallets, accounts, and the auto-posted transaction ledger). Used by cashiers (who collect payment) and owners (who reconcile the books).

1. Identity

PropertyValue
Module IDCORE-08
TierCore
StatusIn-progress
PhaseP1 (payment events) · P2 (finance ledger)
PriorityHIGH
Primary usersCashier (collects), Owner / Manager (reconciles)

Two packages, one business module. Collecting a payment and recording its money are two halves of the same story. The Payment service handles the live payment lifecycle (provider, webhook, real-time status); the Finance service books the resulting income/expense into a double-entry ledger. See §5 Backend Packages.

2. Purpose & Scope

IncludedExcluded
Per-merchant payment provider credentials (VNPAY QR MMS, VNPAY PhonePOS)Direct provider/gateway integration code (lives in the payment engine)
Real-time payment status (webhook + WebSocket broadcast)Checkout / split-payment UX (owned by the Orders module)
Outbound webhook subscriptions per merchantCard-data / token storage
Finance accounts / wallets (CASH, BANK, QR code, mobile POS) + internal control accountsMulti-currency conversion (single currency per voucher)
Double-entry vouchers (RECEIPT / PAYMENT / TRANSFER / ADJUSTMENT)Tax invoice issuance (owned by Tax & Invoice)
Auto-posted income/expense from sale, purchase, and inventory eventsCross-merchant settlement / reconciliation
Income/expense category hierarchy (14 seeded categories + custom)Refund / reversal of external provider charges

3. Capabilities

CapabilityWhat the user can doStatus
Payment provider credentialsOwner connects VNPAY QR MMS / PhonePOS with encrypted per-merchant credentialsBuilt
Live payment statusCashier sees a payment go from pending to paid/failed/expired in real timeBuilt
Webhook subscriptionsConfigure which endpoints receive payment events, with event types and retriesBuilt
Finance accounts / walletsOwner creates wallets (cash, bank, QR, mobile POS) and tracks running balancesBuilt
Auto income on paymentA completed sale payment automatically posts a balanced RECEIPT voucherBuilt
Auto expense on purchase / inventoryReceiving a purchase order or adjusting stock posts the matching voucherBuilt
Transaction ledgerOwner views the double-entry ledger, account balances, and voucher historyBuilt
Manual vouchersOwner records a manual receipt/payment/transfer/adjustment and voids by reversalBuilt
Categories14 seeded income/expense categories plus merchant-specific custom onesBuilt
Refund / reversal of external chargesStructured refund back through the original providerPlanned
Cash reconciliation per shiftExpected vs. actual cash with variancePlanned

4. Module Dependencies

Depends onWhy
OrdersA sale order is what triggers a payment; payment completion settles the order
InventoryStock issue/adjustment events drive expense postings into the ledger
Tax & InvoiceA successful payment can trigger invoice issuance downstream

5. Backend Packages

This module is powered by two services. Implementation detail lives in the developer docs — this section only maps the module to them.

PackageRoleDeveloper docs
@nx/paymentPayment lifecycle: provider credentials, webhook dispatch, real-time status broadcastpayment
@nx/financeDouble-entry bookkeeping: accounts/wallets, vouchers, transaction ledger, categoriesfinance

6. Key User Flows

Collect a payment (Payment service)

Record the money (Finance service)

7. Roles & Permissions

RoleCanCannot
OwnerConnect providers, manage wallets/accounts, create manual vouchers, view ledger
ManagerView ledger, manage accounts, create manual vouchersChange provider credentials (owner-gated)
CashierCollect payments, see live payment statusManage accounts or post manual vouchers

8. Status & Roadmap

PhaseCapabilities
P1Payment provider credentials, webhook + WebSocket payment status, webhook subscriptions
P2Finance accounts/wallets, double-entry vouchers, auto-posting from sale/purchase/inventory events, categories, manual vouchers + void
P3Structured provider refunds, per-shift cash reconciliation with variance

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.