PR: #548: Story-2192: wire Razorpay Checkout for credit top-up (replace dead Stripe route) by @ankitmaheshwari-com
View PR →

Files changed

14 file(s), +392 / -145 lines

Path Role + -
messages/en.jsonConfig+2-0
messages/hi.jsonConfig+2-0
openapi/app-api.jsonConfig+2-1
openapi/permission-map.jsonConfig+7-0
src/app/api/internal/credits/razorpay/order/route.test.tsApp route+57-0
src/app/api/internal/credits/{topup => razorpay/order}/route.tsApp route+5-6
src/components/settings/billing/credits-page.test.tsxComponent+87-70
src/components/settings/billing/credits-page.tsxComponent+62-48
src/components/settings/billing/razorpay-checkout.tsComponent+89-0
src/gen/schemas/agentSessionTurnRequest.jsonGenerated contract+1-1
src/gen/types/AgentSessionTurnRequest.tsGenerated contract+2-1
src/gen/zod/agentSessionTurnRequestSchema.tsGenerated contract+1-1
src/lib/credits/gateway-razorpay.test.tsLibrary+55-0
src/lib/credits/gateway.tsLibrary+20-17

Story-2192: Wire Razorpay Checkout for credit top-up

The firm billing "Buy credits" button called the dead Stripe route POST /app/firm/credits/topup, which returns 503 "Stripe is not configured" — Stripe was never provisioned. PRAMAAN moved to Razorpay, whose backend (order create + S8 signature-verified webhook mint) is already live on staging. This story swaps the app onto the Razorpay Checkout modal.

What landed

Tests

Verification

On-staging check (AC): a firm-admin on the billing page clicks "Buy credits" → the Razorpay Checkout modal opens against rzp_test with the correct amount (no 503/500). After a test payment, the S8 webhook mints the credits and the polled balance reflects them. The webhook mint path is backend-owned (pramaan-functions) and is the runtime boundary this story depends on, not re-proven here.