You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(billing): test-plan-aware tier mapping + PAYMENT_TEST_MODE_ENABLED kill-switch
Two fixes for the test-cohort Razorpay checkout path (the with-UI test-card
payment E2E the CEO asked for):
1. planIDToTier / planIDRecognised now recognise the rzp_test_* plan IDs.
A TEST-mode subscription.activated/charged webhook carries the TEST plan_id;
previously it matched no live RAZORPAY_PLAN_ID_* and fell back to the safe
fallback tier ("hobby") + emitted a bogus billing.charge_undeliverable — so
the full UI card→webhook→Pro chain could NEVER actually reach Pro. Test plans
exist only in Razorpay test mode, so they can't collide with a live plan_id.
2. PAYMENT_TEST_MODE_ENABLED — explicit kill-switch (default FALSE / fail-CLOSED)
gating the whole test-cohort path on TOP of the rzp_test_* secrets. Required
by testModeConfigured() (checkout routing) AND the webhook try-both verify.
Separates the on/off decision (this flag) from the secret values (which stay
in instant-secrets), so an operator can kill test-mode routing instantly
without rotating keys, and a leftover test plan_id can never silently touch a
live customer's billing.
Tests: test-plan tier mapping (+ recognised), kill-switch inert proofs for both
the checkout (403 synthetic_test_cohort when flag off) and webhook (test secret
ignored when flag off) legs; existing cohort tests updated for the new flag.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(config): cover PAYMENT_TEST_MODE_ENABLED parse + add RAZORPAY_TEST_* to allKeys
allKeys() (env host-state clearer) was missing the RAZORPAY_TEST_* vars and the
new PAYMENT_TEST_MODE_ENABLED flag, so a leaked host env could bleed into config
tests. Add them + a TestLoad_PaymentTestModeEnabled mirroring the other *_ENABLED
flag tests (100%-patch coverage for the new parse branch).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments