Skip to content
Docs
Changelog

Billing settings read the env by its own names

The billing settings parser takes the server env record directly, so a new provider variable is two edits instead of four and its tests read like the env file.

Markdown

  • One layer less between the env and billing. parseBillingSettings now takes the server env by its own names (env.STRIPE_SECRET_KEY, env.BILLING_PROVIDERS). The BillingSettingsInput type, which renamed each of the 23 billing variables to camelCase, and the mapping in readBillingSettings are gone. A new provider variable is declared in packages/env/src/server.ts and read in the parser, nothing else. Behavior and validation are unchanged. See Payments and Backend conventions.
  • Tests read like the env file. The test helper's defaults are BILLING_TEST_ENV, an env fragment with three providers on, and a test overrides variables by name: billingSettings({ BILLING_PROVIDERS: "pagarme", PAGARME_WEBHOOK_SIGNATURE: "required" }).
Edit on GitHubDocumentation is in English.
Cookie settings
We use essential cookies to make our app work. With your consent, we also use optional cookies to improve your experience.

Read our Cookie Policy and Privacy Policy.