Commit Graph

19 Commits

Author SHA1 Message Date
Tengku Achmad c32ac1882d feat: update global styles and Tailwind configuration with Inter font; remove obsolete test files and add server documentation
- Added 'Inter' font to global CSS and Tailwind config for improved typography.
- Deleted unused test files related to payment link creation and Snap token testing.
- Created comprehensive README for server setup, API endpoints, and payment flow.
- Added testing documentation for easier integration and usage of the payment system.
2025-12-04 22:57:38 +07:00
CIFO Dev 29b28a389e Fix UX 2025-12-04 17:09:57 +07:00
CIFO Dev 6aa9a0658b fix build 2025-12-04 17:06:02 +07:00
CIFO Dev e9016d507d UX FIX 2025-12-04 16:47:31 +07:00
CIFO Dev c6225e3d35 feat: Add customer name display and improve Snap payment UX
- Add customerName prop to PaymentSheet component
- Display customer name in payment summary below Order ID
- Pass customer name from CheckoutPage form to PaymentSheet
- Fix TypeScript build errors (remove unused variables)
- Improve error logging in API interceptor
- Clean up snapLoader (remove unused snapLoading variable)
- Clean up PayPage (remove unused allowedMethods, runtimeCfg)
- Move lockOrder call to onSuccess callback in PayPage
- Add BOM handling in test-create-payment-link script
- Update test payment data (REFNO-002, TKG-2512041)
2025-12-04 12:45:05 +07:00
CIFO Dev 4bca71aeb3 Fix Snap payment flow: direct to payment UI in step 2 and add customer/item details to API request
- Remove intermediate payment method selection step in PayPage and CheckoutPage
- Update PayPage: direct step 2 payment interface (no wizard)
- Update CheckoutPage: 2-step wizard (form → payment)
- Add customer details (name, email, phone) to SnapPaymentTrigger
- Add item_details to Snap token request (required by Midtrans API)
- Fix 400 error from /api/payments/snap/token endpoint
- Clean up unused imports and variables
- Create payment link generation script (scripts/create-test-payment.mjs)
2025-12-03 17:01:12 +07:00
CIFO Dev d051c46ac4 feat: Epic 6 Stories 6.1-6.5 - Snap Hybrid Payment Strategy
Implemented comprehensive Snap integration with hybrid Core/Snap payment strategy:

Story 6.1 - Environment Switching:
- Added PAYMENT_GATEWAY_MODE env variable (CORE/SNAP)
- Created paymentMode.ts utilities for mode detection
- Added startup validation in main.tsx
- Implemented mode-aware logging with [CORE]/[SNAP] prefixes

Story 6.2 - Snap Payment Flow:
- Created /api/payments/snap/token endpoint
- Implemented SnapPaymentTrigger component with conditional rendering
- Added Snap.js script loading for SNAP mode
- Integrated hosted payment interface

Story 6.3 - Unified Webhook Handler:
- Enhanced /api/payments/notification for Core & Snap
- Implemented mode detection from payload structure
- Added unified signature verification
- Created shared status mapping and ledger updates

Story 6.4 - Shared Backend Logic:
- Created TransactionLogger for unified mode-aware logging
- Implemented OrderManager for shared validation logic
- Added CustomerDataHandler for consistent data sanitization
- Integrated shared utilities across payment endpoints

Story 6.5 - Code Organization:
- Reorganized into core/, snap/, shared/, lib/ structure
- Moved Core components to payments/core/
- Created PaymentAdapter for factory pattern routing
- Added SnapTokenService for token management
- Updated all import paths for new structure

Key Benefits:
 Instant rollback via environment variable
 Infrastructure offloading to Midtrans hosted interface
 Clean separation of Core vs Snap implementations
 Unified webhook processing for both modes
 Shared utilities eliminate code duplication

Technical Details:
- TypeScript compilation successful (549KB bundle)
- All payment methods work in both CORE and SNAP modes
- Dynamic component loading for Core components
- Mode-aware logging throughout payment flow
- Backwards compatible with existing Core API implementation
2025-12-03 15:33:22 +07:00
CIFO Dev dd975ad222 new improvement 2025-11-25 16:24:52 +07:00
CIFO Dev d08b0bd312 feat(payments): complete Story 1.1 - Add loading overlay and error messages to all payment panels
- Updated GoPayPanel with LoadingOverlay and mapErrorToUserMessage
- Updated CStorePanel with LoadingOverlay and mapErrorToUserMessage
- All 3 payment methods now show user-friendly Bahasa Indonesia error messages
- Full-screen loading overlay prevents duplicate payment code generation

Story: 1.1 - Prevent Duplicate VA/QR/Code Generation & Improve Feedback
Status: Complete
2025-11-25 14:24:54 +07:00
CIFO Dev 4eccff2c03 feat(payments): implement Story 1.1 - Add error messages utility, loading overlay, and update BankTransferPanel
- Created src/lib/errorMessages.ts for user-friendly Bahasa Indonesia error messages
- Created src/components/LoadingOverlay.tsx with Framer Motion animations
- Updated BankTransferPanel with LoadingOverlay and mapErrorToUserMessage
- All 4 error catch blocks now use user-friendly messages
- GoPayPanel imports restored (ready for next iteration)

Story: 1.1 - Prevent Duplicate VA/QR/Code Generation & Improve Feedback
Status: Partial (BankTransferPanel complete, GoPayPanel & CStorePanel pending)
2025-11-25 14:04:41 +07:00
Tengku Achmad b98c50cea8 refactor(payments): remove indomaret support and update navigation 2025-11-24 20:22:01 +07:00
Tengku Achmad 5034ecf1e4 feat: replace demo store with initial page and improve payment UI 2025-11-24 09:53:20 +07:00
Tengku Achmad ec96b71161 feat(payments): extend payment link expiration to 24 hours
Update default payment link TTL from 30 minutes to 24 hours across frontend and backend. Also modify countdown display to show hours in addition to minutes and seconds.
2025-11-22 11:54:46 +07:00
Tengku Achmad e1f989447b feat: implement toast notifications and update UI components
refactor: remove dark mode styles and simplify UI components
style: update color scheme and branding to new blue theme
feat(toast): add toast notification system for user feedback
fix: correct merchant name and update payment sheet styling
docs: update comments and remove unused code
2025-11-14 15:13:46 +07:00
CIFO Dev 4d10f0e121 perbaikan flow 2025-11-10 16:59:31 +07:00
CIFO Dev 0201274182 payments: konsistenkan varian tombol dan penataan VA
- Ubah semua Button varian 'ghost' menjadi 'outline' di CardPanel, GoPayPanel, CStorePanel, InlinePaymentStatus untuk konsistensi tipe dan styling\n- Hilangkan logo per-bank dari BankTransferPanel; hanya tampilkan nama bank\n- Perbaiki tampilan Nomor VA: pindah ke baris baru, wrap (reak-all), ukuran font responsif, kurangi tracking\n- Tampilkan gambar 'logo semua bank' di header metode Transfer bank (kanan) dan panel pilihan di Step 2\n- Perbesar ikon logo agar jelas dan seragam di PaymentMethodList\n- Penyesuaian ringan di PaymentSheet untuk CTA status
2025-11-10 14:50:55 +07:00
CIFO Dev b07c267704 chore(assets): point bank logos to files in public/logos
PaymentLogos: update BANK_LOGOS src to match current asset filenames (BCA, BNI, BRI, CIMB, Mandiri, Permata). Ensures PaymentMethodList and panels render new logos.
2025-11-10 13:28:58 +07:00
CIFO Dev 343afa2af9 feat: improve payments UX (VA layout, instructions, accessibility)
BankTransferPanel: VA card above instructions; clearer borders; aria-live for VA status; dynamic 'Instruksi pembayaran' panel.\nBcaInstructionList: ARIA roles for tablist/tabs/tabpanels; stronger visual cues; 3px focus ring.\nGoPayPanel: auto display instructions with dynamic steps per mode; clearer mode toggle buttons; 3px focus ring.\nButton: standardize 3px focus ring with 2px offset and accent color.\nPaymentMethodList: enhanced contrast, thicker borders, larger targets for seniors.\nPaymentInstructions: flexible title and steps; never empty with sensible fallback.
2025-11-10 12:06:34 +07:00
CIFO Dev 4862c32978 feat(payments): stabilisasi QRIS & CStore; hapus tombol Buat QR
GoPay: spinner QRIS dalam frame, hilangkan QR dummy saat menunggu, hapus tombol Buat QR, sanitasi URL actions. CStore: panel pilihan toko di Step 2, auto-generate kode dengan guard StrictMode, perbaiki busy agar tidak nyangkut setelah respons 201. Checkout: jangan auto-advance untuk CStore, oper defaultStore sesuai pilihan. BankTransfer: stabilisasi in-flight promise untuk VA (sebelumnya).
2025-11-10 11:10:35 +07:00