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
Enables a synthetic test-cohort team (teams.is_test_cohort=true, mig 067) to
drive a REAL Razorpay TEST-mode hosted checkout + test-card payment in CI with
NO real money and WITHOUT the live-recurring approval that blocks prod (test
mode has no recurring gate). The live billing path is provably untouched.
docs/ci/01-CI-INTEGRATION-DESIGN.md §"Razorpay test-card payment E2E".
Config (all default "" = INERT; never leak in any response):
RAZORPAY_TEST_KEY_ID / _SECRET / _WEBHOOK_SECRET
RAZORPAY_TEST_PLAN_ID_{HOBBY,HOBBY_PLUS,PRO}
Routing (CreateCheckoutAPI):
- cohort + test key/secret + tier test-plan set → mint via rzp_test_*
(resolveCheckoutTestMode), swap to the test plan_id, route the create
through test creds via a private subBody flag (subBodyTestModeKey, stripped
before Razorpay), and bypass the live-key / billing_not_configured guards.
- cohort + test mode unset/partial → inert: existing synthetic_test_cohort
403 skip; never mints against the live plan; no crash.
- non-cohort → ALWAYS the live path, regardless of test-key config.
- DB blip on is_test_cohort → fail CLOSED (live path), never route a real
customer through the test account.
Webhook: try-both verification (live secret first, then RAZORPAY_TEST_WEBHOOK_
SECRET) so a real TEST-mode subscription.charged/activated upgrades the cohort
team; live webhooks unaffected; unset test secret is a no-op; constant-time.
Tests (internal/handlers green): pure-function inert proofs (no DB, always run)
+ DB-gated routing (cohort uses test plan, inert-when-unset, inert-when-no-plan,
non-cohort live path, key-leak contract) + webhook try-both/inert.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments