Skip to content

feat(payments): M4.1 UPI-first checkout, dynamic QR, and verified payments - #28

Merged
Satelink-Protocol merged 2 commits into
launch-mvpfrom
feature/m4-1-upi-checkout
Nov 3, 2026
Merged

Satelink-Protocol merged 2 commits into
launch-mvpfrom
feature/m4-1-upi-checkout

Conversation

@Satelink-Protocol

Copy link
Copy Markdown
Contributor

Summary of Milestone M4.1

This PR delivers Milestone M4.1 (UPI-First Checkout, Dynamic QR & Verified Payment Integration) for NIGHTLIFEZ.

1. Key Capabilities Implemented

  • Provider-Neutral Payment Adapter Interface (lib/upi/adapter.js): Standardized interface (createPaymentIntent, getPaymentStatus, verifyWebhook, initiateRefund). Primary implementation: PhonePe Payment Gateway. Test sandbox: MockUpiAdapter. PayU fallback ready.
  • Zero-Dependency Vector QR Generator (lib/upi/qr.js): Standalone ECMAScript ISO/IEC 18004 Model 2 QR generator with Byte mode encoding and Reed-Solomon Error Correction Level M. Generates lightweight, crisp SVG elements with NPCI UPI formatting (upi://pay?pa=...).
  • Device-Adaptive Checkout UI (lib/views/checkout-upi.js, lib/handlers/upi-checkout.js):
    • Mobile: Generic UPI intent launch (upi://pay) plus app-specific deep links (Google Pay, PhonePe, Paytm, CRED, BHIM).
    • Desktop: High-resolution vector SVG QR code with real-time 15-minute countdown clock, 3.5s auto-polling, manual refresh, and auto-expiry blur.
  • Deterministic Finite State Machine & Audit Ledger (lib/services/upi-payments.js): Enforces states (created, pending, processing, succeeded, failed, expired, cancelled, refund_pending, refunded, disputed). All state mutations are recorded in the new payment_audits ledger.
  • Additive Database Migration 015 (migrations/015_upi_payment_integration.sql): Extends enums and payments table with order reference, merchant ID, method, device type, UPI URIs, and audit columns. Creates payment_audits table.
  • Zero-Trust Security & Webhook Verification: Constant-time comparison (crypto.timingSafeEqual) of PhonePe SHA256 checksums. Webhook replay defense and atomic database transactions (db.tx).
  • Safety Boundary Preserved: ENABLE_LIVE_PAYMENTS=false strictly enforced across all environments.

2. Deliverables

  • docs/arch/UPI_PAYMENT_INTEGRATION.md: Complete architectural specification, provider evaluation matrix, dynamic QR/intent specs, state transition tables, and RBI compliance notes.
  • docs/launch/UPI_READINESS_REPORT.md: Operational readiness checklist, safety boundary verification, and owner activation gates.
  • Updated docs/PROJECT_STATE.md (Sections 10 and 11).

3. Automated Test Verification

  • All 13 tests in test/upi-checkout.test.js pass 100%.
  • All 444 tests across the entire repository test suite pass 100% (npm test).
  • Full lint check passes cleanly (140/140 files OK).
  • Repository-wide scan verifies 0 occurrences of prohibited legacy provider names.

…rified payments

- Add additive migration 015_upi_payment_integration.sql extending payment types and introducing immutable payment_audits ledger
- Implement zero-dependency pure SVG QR code generator (Model 2, Reed-Solomon EC) in lib/upi/qr.js
- Implement provider-neutral payment adapter interface with PhonePe PG primary and MockUpi sandbox adapter in lib/upi/adapter.js
- Support mobile generic upi://pay intent and deep links for Google Pay, PhonePe, Paytm, CRED, and BHIM
- Support desktop scannable dynamic QR with live 15m countdown timer and 3.5s status polling
- Implement strict deterministic payment state machine with atomic booking confirmation in lib/services/upi-payments.js
- Add constant-time SHA256 webhook signature verification with replay protection and idempotency
- Maintain strict safety boundary: ENABLE_LIVE_PAYMENTS=false across all environments
- Add comprehensive test suite in test/upi-checkout.test.js (13/13 passing)
- Author docs/arch/UPI_PAYMENT_INTEGRATION.md and docs/launch/UPI_READINESS_REPORT.md
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
strangersmeetup Ready Ready Preview Nov 3, 2026 4:18am UTC

@Satelink-Protocol
Satelink-Protocol merged commit c3b4e83 into launch-mvp Nov 3, 2026
3 checks passed
@Satelink-Protocol
Satelink-Protocol deleted the feature/m4-1-upi-checkout branch November 3, 2026 04:23
Satelink-Protocol added a commit that referenced this pull request Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant