Skip to content

fix(payments): separate UPI_CHECKOUT_ENABLED from ENABLE_LIVE_PAYMENTS (S3a) - #42

Merged
Satelink-Protocol merged 1 commit into
launch-mvpfrom
fix/s3a-upi-checkout-flag
Nov 10, 2026
Merged

Satelink-Protocol merged 1 commit into
launch-mvpfrom
fix/s3a-upi-checkout-flag

Conversation

@Satelink-Protocol

Copy link
Copy Markdown
Contributor

S3a launch-blocking fix. Feature freeze: no new behaviour beyond splitting one flag into two.

Before

ENABLE_LIVE_PAYMENTS=true opened both the SuperProfile hosted link-out and the PhonePe/UPI checkout (lib/payments/availability.js, lib/services/upi-payments.js). Turning on SuperProfile would also have turned on UPI, which cannot meet the verification contract (Outcome B, docs/UPI_PROVIDER_READINESS.md).

After

Flag Gates Default
ENABLE_LIVE_PAYMENTS SuperProfile hosted link-out only false
UPI_CHECKOUT_ENABLED (new) every UPI/PhonePe surface (below) false; opens only on the exact string true

While UPI_CHECKOUT_ENABLED is off, all of these return 404, checked before rate limits and body reads:

  • GET /checkout/:slug/upi
  • POST /api/checkout/upi/intent
  • GET /api/checkout/upi/status/:id
  • POST /api/checkout/upi/claim, and the Telegram /start claim_upi_… path, guarded in the service
  • POST /api/payments/webhook/phonepe

GET /checkout/:slug on a upi_direct event redirects to the event page instead of the closed UPI page. The /api/health config now also reports upiCheckout. Refunds of already-captured payments are deliberately not gated. The Preview guard (ALLOW_PREVIEW_PAID_CHECKOUT) still applies to both rails.

Tests

New file test/payment-flags.test.js:

  • ENABLE_LIVE_PAYMENTS=true + UPI_CHECKOUT_ENABLED=false: SuperProfile 302 to the product works; UPI page, intent, status, claim and PhonePe webhook all 404; no intent row; free booking confirmed.
  • Both false: SuperProfile hand-off refused (redirects to the event page), every UPI route 404, free booking confirmed.
  • UPI_CHECKOUT_ENABLED=true + ENABLE_LIVE_PAYMENTS=false: UPI opens on its own flag, SuperProfile stays closed, free booking confirmed.
  • TRUE and 1 do not open UPI.

Updated tests:

  • The UPI suite now runs with UPI_CHECKOUT_ENABLED=true and ENABLE_LIVE_PAYMENTS=false, which proves independence.
  • The safety-boundary tests expect 404 from the UPI flag.

Local, full suites on c9ae631:

  • lint: 154/154 OK.
  • npm test: 699 tests, 697 pass, 0 fail, 2 skipped.
  • npm run test:e2e: 182 tests, 171 passed, 11 skipped (viewport-gated), 0 failed.

Production / Preview env

Set UPI_CHECKOUT_ENABLED=false (or leave it unset) everywhere.

Rollback

Revert this commit. Without the new flag, behaviour returns to "ENABLE_LIVE_PAYMENTS gates both".

🤖 Generated with Claude Code

ENABLE_LIVE_PAYMENTS used to open both the SuperProfile link-out and the
PhonePe/UPI checkout. It now gates only the SuperProfile hosted link-out.
A new UPI_CHECKOUT_ENABLED flag (default false, exact 'true' only) gates
every UPI surface: the /checkout/:slug/upi page, intent creation, status
polling, guest claim (HTTP and Telegram), and the PhonePe webhook. Each
returns 404 while off, and the generic /checkout/:slug link falls back
to the event page instead of handing off to the closed UPI page.
Refunds of already-captured payments are deliberately not gated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 10, 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 10, 2026 9:56am UTC

@Satelink-Protocol
Satelink-Protocol merged commit dc671d3 into launch-mvp Nov 10, 2026
3 checks passed
@Satelink-Protocol
Satelink-Protocol deleted the fix/s3a-upi-checkout-flag branch November 10, 2026 10:07
Satelink-Protocol added a commit that referenced this pull request Nov 10, 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