{"record":{"id":"d6a12d267ee7549b","repo":"hcengineering/platform","slug":"payment-provider-is-not-configured","errorCode":null,"errorMessage":"Payment provider is not configured","messagePattern":"Payment provider is not configured","errorType":"http","errorClass":null,"httpStatus":503,"severity":"error","filePath":"services/payment/pod-payment/src/server.ts","lineNumber":198,"sourceCode":"  )\n\n  // ============ Generic Payment Service Endpoints ============\n  // These endpoints are provider-agnostic and work with any payment provider\n\n  /**\n   * POST /api/v1/subscriptions/:workspace/subscribe\n   * Create a subscription for a workspace\n   * Body: SubscribeRequest { type: 'tier' | 'support', plan: string, ... }\n   */\n  app.post(\n    '/api/v1/subscriptions/:workspace/subscribe',\n    subscriptionRateLimiter,\n    withToken,\n    withLoginInfo,\n    withOwner,\n    (req: RequestWithAuth, res: Response) => {\n      if (provider === undefined || serviceToken === undefined) {\n        res.status(503).json({ error: 'Payment provider is not configured' })\n        return\n      }\n\n      void handleRequest(\n        ctx,\n        'create-subscription',\n        async (ctx) => {\n          const workspaceUuid = req.token?.workspace\n          const accountUuid = req.token?.account\n          const request = req.body as SubscribeRequest\n          const loginInfo = req.loginInfo as WorkspaceLoginInfo\n\n          if (accountUuid === undefined) {\n            res.status(401).json({ error: 'Missing account in token' })\n            return\n          }\n\n          if (workspaceUuid === undefined) {","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/services/payment/pod-payment/src/server.ts#L180-L216","documentation":"The create-subscription route responds 503 'Payment provider is not configured' when the provider or serviceToken was undefined at server creation time. The payment capability is intentionally disabled because required configuration (provider selection / credentials) was not supplied to createServer.","triggerScenarios":"createServer invoked without a payment provider (e.g. POLAR vs STRIPE selection env var unset) or without the service token; deployment missing payment-related env vars; feature deliberately disabled for that environment.","commonSituations":"Fresh staging environment where only the DB and auth env vars were configured; docker-compose file omitting payment secrets; config typo in the provider env var name.","solutions":["Set the payment provider configuration env vars (provider name + API key + service token) and restart the service","Check deployment/secrets (helm values, .env, secret manager) actually include the payment provider keys","Verify the config-loading code maps the env vars into the provider/serviceToken passed to createServer","If the provider is intentionally disabled, don't expose/call the subscription endpoints"],"exampleFix":"// before (env)\n# PAYMENT_PROVIDER unset\n// after\nPAYMENT_PROVIDER=stripe\nSTRIPE_API_KEY=sk_live_...\nSTRIPE_WEBHOOK_SECRET=whsec_...\nSERVICE_TOKEN=...","handlingStrategy":"validation","validationCode":"if (process.env.PAYMENT_PROVIDER === undefined || process.env.PAYMENT_SERVICE_TOKEN === undefined) {\n  throw new Error('Payment provider env vars must be set before starting the server')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate all required env vars at startup, fail fast before listening","Add a readiness/health check that reports payment-provider config status","Keep payment secrets in the deployment secret manager for every environment","Document required env vars per provider (stripe/polar)"],"tags":["configuration","env-var","http-503","payment"],"backgroundTag":"missing-env-var","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}