Order Management & Square Integration Settings

Dashboard order management with void support, Square integration settings for location and customer sync, per-merchant billing address configuration, and critical bug fixes.
Order Management
The merchant dashboard now includes full order management pages. The order listing page supports pagination and filtering by status, payment status, and search by order ID or customer name. Each order detail page shows line items, a financial breakdown, customer info, and timestamps.
Merchants can void open, unpaid orders directly from the dashboard — cancellation propagates to external POS systems like Square automatically. A stale order detection system alerts merchants when Square locations have lingering open orders, with a bulk void option to clean them up.
Square Integration Settings
The Square integration page now includes a settings panel with toggles for:
- Location sync — A weekly cron job syncs Square locations, creating new ones, updating metadata, preserving merchant-customized names, and deactivating removed locations. A "Sync now" button is available for on-demand syncing.
- Customer sync — A daily two-way sync between Decal and Square. Inbound creates or updates Decal customers from Square; outbound pushes new Decal customers to Square. Conflicts resolve via most-recent-update-wins with email-based matching for initial linking.
- Stale order auto-cancellation — Automatically cancels stale Square orders when enabled. Orders are upserted into Decal first for visibility, then cancelled on Square.
Card Billing Address Configuration
Merchants can now be configured to require either full billing address (address, city, state, zip, country) or minimal card details only for card payments. The checkout form conditionally renders address fields based on the merchant's configuration. Existing merchants default to full address.
Minor Improvements
- Fixed a critical mode consistency bug where toggling between test and live mode kept the original customer record, allowing a live customer to join a test Stored Value program. Mode toggle now re-resolves the customer in the target mode, with defense-in-depth validation at the database level.
- Square payments now include the Decal transaction ID as a reference for merchant cross-referencing, with deterministic idempotency keys for retry safety.
- Fixed card checkout failing with "Order not found" on Square locations due to typed IDs being passed directly to the Square API.
- Card payment error messages no longer leak internal configuration details — unknown errors now return a generic fallback message.
- Fixed tax double-counting when adding a balance top-up to Square orders with additive taxes.
- Cancelled orders no longer incorrectly trigger the "order details changed" dialog.
- Empty orders now show a clear "Order Empty" status instead of a broken $0.00 receipt.
- All open payment sheets close automatically when an order is completed or cancelled via polling.