Skip to content

subscription-stripe

Stripe payment provider plugin for billing-foundation. Reads its Stripe API key + webhook secret from system config keys with backing:"secrets" (envelope-encrypted in the secrets store under the system tenant) and a billingLive system config flag — all at runtime, so keys rotate and prod goes live without a redeploy. The mask on each key derives the sysadmin settings screen + nav, so no app wires a hand-written config UI. Mount via createSubscriptionStripeFeature({ priceToTier }); the optional apiKey/webhookSecret options are env→secrets bridge fallbacks. The plugin always mounts — createCheckoutSession throws feature_disabled unless billingLive is true, so sk_test_ keys in prod never produce a live checkout. Implements all four provider methods (webhook verify, checkout, portal, cancel).

What this feature needs to run (Requires, top) and the write commands it provides (Provides, bottom).

flowchart TB
  n_subscription_stripe["subscription-stripe"]
  subgraph how_reqs["Requires"]
    n_billing_foundation["billing-foundation"]
    n_config["config"]
    n_secrets["secrets"]
  end
  n_billing_foundation --> n_subscription_stripe
  n_config --> n_subscription_stripe
  n_secrets --> n_subscription_stripe

Per-tenant config keys, set via the tenant-admin UI or a seed. 🔒 = encrypted at rest.

KeyTypeDefaultScopeWho can writeWho can read
api-keytextsystemSystemAdminTenantAdmin, Admin, SystemAdmin
billing-livebooleanfalsesystemsystem, SystemAdminTenantAdmin, Admin, SystemAdmin
webhook-secrettextsystemSystemAdminTenantAdmin, Admin, SystemAdmin
  • Registers extension: subscriptionProviderstripe