Repository navigation
fix(payments): separate UPI_CHECKOUT_ENABLED from ENABLE_LIVE_PAYMENTS (S3a) - #42
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
S3a launch-blocking fix. Feature freeze: no new behaviour beyond splitting one flag into two.
Before
ENABLE_LIVE_PAYMENTS=trueopened 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
ENABLE_LIVE_PAYMENTSfalseUPI_CHECKOUT_ENABLED(new)false; opens only on the exact stringtrueWhile
UPI_CHECKOUT_ENABLEDis off, all of these return 404, checked before rate limits and body reads:GET /checkout/:slug/upiPOST /api/checkout/upi/intentGET /api/checkout/upi/status/:idPOST /api/checkout/upi/claim, and the Telegram/start claim_upi_…path, guarded in the servicePOST /api/payments/webhook/phonepeGET /checkout/:slugon aupi_directevent redirects to the event page instead of the closed UPI page. The/api/healthconfig now also reportsupiCheckout. 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.UPI_CHECKOUT_ENABLED=true+ENABLE_LIVE_PAYMENTS=false: UPI opens on its own flag, SuperProfile stays closed, free booking confirmed.TRUEand1do not open UPI.Updated tests:
UPI_CHECKOUT_ENABLED=trueandENABLE_LIVE_PAYMENTS=false, which proves independence.Local, full suites on
c9ae631: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