Feature #9507
openworking on Dejavo issues raised by mahanandh
Added by Teja Sriram Sangani about 1 month ago. Updated about 1 month ago.
100%
Files
| POS_screen_splitchanges.txt (14.2 KB) POS_screen_splitchanges.txt | changes what i do document | Teja Sriram Sangani, 07/02/2026 10:38 AM | Delete |
Subtasks
Related issues
Updated by Teja Sriram Sangani about 1 month ago
- Status changed from New to In Progress
- % Done changed from 10 to 30
Updated by Teja Sriram Sangani about 1 month ago
- File POS_screen_splitchanges.txt POS_screen_splitchanges.txt added
- Due date set to 07/02/2026
- % Done changed from 30 to 80
- POS Dejavoo (CPP) — Split Payment Fixes
1. Fixed Dejavoo 400 error on split payments
- Root cause: `ReferenceId` exceeded Dejavoo’s 50-character limit.
- Added short reference IDs: `POS-S{index}-{timestamp}`.
- Sanitized `CustomFields` metadata (string only, max 200 chars).
- Removed extra metadata (`saleId`, `splitIndex`) that caused API rejection.
2. Dejavoo works inline in split payment
- Split flow uses only `create-split-sale` + `split-payment`.
- CPP is processed on the backend inside `split-payment` (no separate Dejavoo API call from frontend per line).
- Same terminal flow as single CPP payment.
3. Better Dejavoo error messages
- Axios 400 errors converted to staff-friendly messages.
- Handles decline, terminal cancel, and host-no-response cases.
- Split Payment — Cancel & Resume Flow
4. Two different cancel behaviors
- Cancel current payment (card manual / reader): only cancels in-flight payment, returns to payment selection, does not cancel the whole sale.
- Cancel entire sale (close modal after money collected): shows refund confirmation dialog.
5. Cancel Payment dialog (`SplitPaymentCancelDialog`)
- Title: “Cancel Payment?”
- Shows what to return: Zelle, CPP, Cash, Card (all as cash return guidance).
- Two totals:
- Total to return (all paid methods)
- If cash was NOT collected (Zelle + CPP + Card only)
6. Resume split payment API (`resume-split-payment`)
- Continue paying after partial failure/cancel.
- Already-paid lines (CPP, Zelle, Cash) are preserved — never re-charged.
- Only remaining balance is processed.
7. Fixed $92 vs $98 mismatch on resume
- Frontend “Paid” state could drift from backend.
- Added reconciliation (`computeReconciledLines`) so UI matches what server actually settled before charging again.
- Payment Status & Flexibility (UX)
8. Per-method status chips
- Paid (green), Failed (red), Cancelled (orange) beside each payment line.
- Card manual cancel now shows Cancelled, not silently back to pending.
9. Failed/cancelled methods stay editable
- Staff can change amount, switch method, or remove the line.
- Other methods are not disabled when one fails.
10. Top-up on already-paid lines
- Can increase a paid CPP/Zelle/Cash line.
- Only the extra delta is charged on submit (no double-charge / loops).
- Chips show Paid $X and Pay $Y more when amount is increased.
11. “Add remaining to last payment” fixed
- Works even when last line is already paid (top-up scenario).
- No more “No editable payment method found” error in valid cases.
- Zelle Gate
12. Zelle confirmation is mandatory
- Zelle modal must be confirmed before moving to next payment step.
- Already-paid Zelle lines are not re-prompted.
- Top-up on paid Zelle still requires confirmation for the extra amount.
- Cash Payment Improvements
13. Received Amount behavior
- Auto-syncs when cash Amount changes (rounded up for change).
- Field is editable if staff need to override manually.
- Manual edit stops auto-sync for that line.
14. Received = total cash (collected + paying now)
- Example: $7.70 already collected + $19 due → Received shows $26.70.
- Label shows: `($7.70 collected · pay $19.00 more)` or `· return $X` if decreased.
15. Cash shortage blocks payment
- If total received < full cash amount, Process Payment is disabled.
- Hover shows tooltip + warning notification.
16. Cash decrease on paid line = return
- Lowering amount below what was paid shows return $X in the label.
- Cash can be decreased (physical return to customer); other paid methods cannot go below settled amount.
17. +/- buttons on Received Amount fixed
- Work on paid/top-up cash lines (not blocked by “completed” status).
- Modal Summary Panel
18. Paid so far / To pay totals
- Right panel shows Paid so far and To pay during partial split payments.
- Helps staff see remaining balance clearly.
- Documentation
19. Technical doc created for the team
- File: `docs/POS_DEJAVOO_INTEGRATION.md`
- Covers: env setup, APIs, single/split/resume flows, cancel logic, errors, testing checklist, sequence diagram.
- Key Files Changed (for dev reference)
| Area | File |
| ------ | ------ |
| Dejavoo API | `evergreen_pos_be/src/services/payment/dejavoo.service.js` |
| Split / Resume APIs | `evergreen_pos_be/src/controllers/nursery/nursery.product.controller.js` |
| Routes | `evergreen_pos_be/src/routes/nursery/sale.route.js` |
| Split validation | `evergreen_pos_be/src/utils/splitPayment.utils.js` |
| Payment UI | `evergreen_pos_fe/src/pages/Nuresy/POS/PaymentComponentNew.tsx` |
| Cancel dialog | `evergreen_pos_fe/src/pages/Nuresy/POS/SplitPaymentCancelDialog.tsx` |
| KT doc | `docs/POS_DEJAVOO_INTEGRATION.md` |
- Quick Test Scenarios for QA
20. Suggested tests
- Split: CPP + Zelle + Cash + Card Manual → cancel card → resume with another method.
- CPP paid → increase cash amount → check “collected / pay more” label.
- Close modal after partial pay → verify Cancel Payment dialog totals.
- Dejavoo split with amounts that previously caused 400 error.
Updated by Teja Sriram Sangani about 1 month ago
- Status changed from In Progress to Resolved
- % Done changed from 80 to 100
Updated by Teja Sriram Sangani about 1 month ago
- Due date changed from 07/02/2026 to 07/03/2026