diff --git a/packages/billing/core/src/create-billing-schema.ts b/packages/billing/core/src/create-billing-schema.ts index ce4f9c875..c0d79ad39 100644 --- a/packages/billing/core/src/create-billing-schema.ts +++ b/packages/billing/core/src/create-billing-schema.ts @@ -252,6 +252,11 @@ const ProductSchema = z description: 'Highlight this product. Displayed to the user.', }) .optional(), + hidden: z + .boolean({ + description: 'Hide this product from being displayed to users.', + }) + .optional(), plans: z.array(PlanSchema), }) .refine((data) => data.plans.length > 0, { diff --git a/packages/billing/gateway/src/components/plan-picker.tsx b/packages/billing/gateway/src/components/plan-picker.tsx index cbb291ba4..c186864aa 100644 --- a/packages/billing/gateway/src/components/plan-picker.tsx +++ b/packages/billing/gateway/src/components/plan-picker.tsx @@ -108,6 +108,11 @@ export function PlanPicker( const isRecurringPlan = selectedPlan?.paymentType === 'recurring' || !selectedPlan; + // Always filter out hidden products + const visibleProducts = props.config.products.filter( + (product) => !product.hidden, + ); + return (