hcengineering/platform · error
Payment provider is not configured
Error message
Payment provider is not configured
What it means
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.
Source
Thrown at services/payment/pod-payment/src/server.ts:198
)
// ============ Generic Payment Service Endpoints ============
// These endpoints are provider-agnostic and work with any payment provider
/**
* POST /api/v1/subscriptions/:workspace/subscribe
* Create a subscription for a workspace
* Body: SubscribeRequest { type: 'tier' | 'support', plan: string, ... }
*/
app.post(
'/api/v1/subscriptions/:workspace/subscribe',
subscriptionRateLimiter,
withToken,
withLoginInfo,
withOwner,
(req: RequestWithAuth, res: Response) => {
if (provider === undefined || serviceToken === undefined) {
res.status(503).json({ error: 'Payment provider is not configured' })
return
}
void handleRequest(
ctx,
'create-subscription',
async (ctx) => {
const workspaceUuid = req.token?.workspace
const accountUuid = req.token?.account
const request = req.body as SubscribeRequest
const loginInfo = req.loginInfo as WorkspaceLoginInfo
if (accountUuid === undefined) {
res.status(401).json({ error: 'Missing account in token' })
return
}
if (workspaceUuid === undefined) {View on GitHub (pinned to 63e28dc964)
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
Example fix
// before (env) # PAYMENT_PROVIDER unset // after PAYMENT_PROVIDER=stripe STRIPE_API_KEY=sk_live_... STRIPE_WEBHOOK_SECRET=whsec_... SERVICE_TOKEN=...
Defensive patterns
Strategy: validation
Validate before calling
if (process.env.PAYMENT_PROVIDER === undefined || process.env.PAYMENT_SERVICE_TOKEN === undefined) {
throw new Error('Payment provider env vars must be set before starting the server')
} Prevention
- 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)
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- Payment service URL not specified
- Authentication token not specified
- Missing productIds for plan: ${planKey}
- No products configured for plan: ${planKey}
- Missing config for attributes: ${missingEnv.join(', ')}
AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29).
Data as JSON: /api/errors/d6a12d267ee7549b.
Report an issue: GitHub.