How amant-creator/verify_payments works
This is a Next.js UPI checkout and merchant payment-verification system. Customers create an order, open its checkout to pay by UPI deep link or QR, and return to a live verification page. The merchant approves or rejects through Telegram or the admin dashboard; the customer sees the resulting status. Persisted timestamps drive two verification countdown stages and an overdue manual-review state. The graph includes the documented dashboard and security capabilities; some route wiring is not shown in the excerpts, so those relationships are omitted where they cannot be evidenced.
Main entry points: page.tsx Checkout Session · db.ts Order Repository · route.ts Order API · VerificationView.tsx Verification Display
Components 29
Customer Checkout
- Order Storefront
app/page.tsx - Checkout Session
app/checkout/[orderId]/page.tsx - Payment Display
components/CheckoutView.tsx - Verification Display
components/VerificationView.tsx - Countdown Timer
components/CountdownTimer.tsx - Success Result
components/SuccessView.tsx - Rejected Result
components/RejectedView.tsx
Verification Workflow
- Order API
app/api/orders/route.ts - Return Handler
app/api/orders/[orderId]/return/route.ts - Launch Handler
app/api/orders/[orderId]/launch/route.ts - UTR Handler
app/api/orders/[orderId]/utr/route.ts - Order Status API
app/api/orders/[orderId]/route.ts - SSE Stream
app/api/orders/[orderId]/stream/route.ts
Merchant Decisions
- Admin Dashboard
app/admin/page.tsx - Decision Handler
app/api/orders/[orderId]/decision/route.ts - Telegram Webhook
app/api/telegram/webhook/route.ts - Admin Debug API
app/api/admin/debug/route.ts
Runtime Services
- UPI Formatting
lib/upi.ts - Timer Logic
lib/timer.ts - Telegram Service
lib/telegram.ts - Order Repository
lib/db.ts - Customer Firebase
lib/firebase.ts - Admin Secret Check
lib/auth.ts - Firestore Rules
firestore.rules - Order Model
types/order.ts
Other components
- Customer
- UPI App
- Telegram Bot API
- Firestore
Connections 34
- Customer → Order Storefront: opens
README.md - Order Storefront → Checkout Session: opens checkout
README.md - Customer → Order API: creates order
README.md - Order API → Order Repository: creates order
app/api/orders/route.ts - Order API → Telegram Service: notifies merchant
app/api/orders/route.ts - Checkout Session → Payment Display: renders payment
app/checkout/[orderId]/page.tsx - Payment Display → UPI Formatting: formats amount
components/CheckoutView.tsx - Checkout Session → UPI Formatting: builds payment URI
README.md - Customer → UPI App: launches payment
README.md - Checkout Session → Launch Handler: records launch
- Customer → Checkout Session: returns to
README.md - Checkout Session → Return Handler: reports return
app/checkout/[orderId]/page.tsx - Return Handler → Order Repository: records verification
app/api/orders/[orderId]/return/route.ts - Checkout Session → Customer Firebase: subscribes to order
app/checkout/[orderId]/page.tsx - Checkout Session → Timer Logic: derives countdown
app/checkout/[orderId]/page.tsx - Checkout Session → Verification Display: renders pending state
app/checkout/[orderId]/page.tsx - Verification Display → Countdown Timer: renders timer
components/VerificationView.tsx - Verification Display → UPI Formatting: formats amount
components/VerificationView.tsx - Verification Display → UTR Handler: submits reference
- Checkout Session → Success Result: renders approval
app/checkout/[orderId]/page.tsx - Checkout Session → Rejected Result: renders rejection
app/checkout/[orderId]/page.tsx - Admin Dashboard → Timer Logic: derives countdown
app/admin/page.tsx - Admin Dashboard → Order API: lists orders
- Admin Dashboard → Decision Handler: submits decision
- Decision Handler → Order Repository: records decision
app/api/orders/[orderId]/decision/route.ts - Decision Handler → Admin Secret Check: checks secret
app/api/orders/[orderId]/decision/route.ts - Telegram Webhook → Order Repository: records decision
app/api/telegram/webhook/route.ts - Telegram Webhook → Telegram Service: updates message
app/api/telegram/webhook/route.ts - Telegram Service → Telegram Bot API: calls bot API
lib/telegram.ts - Admin Debug API → Order Repository: checks storage
app/api/admin/debug/route.ts - Order Repository → Firestore: reads and writes
lib/db.ts - Customer Firebase → Firestore: subscribes
- Firestore Rules → Firestore: restricts access
README.md - Order API → Order Model: creates model
app/api/orders/route.ts