From bc2e4e23c9565a16ee88e33e23e498f18d67936a Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 15 Sep 2025 15:53:15 -0400 Subject: [PATCH] wip: zen --- cloud/app/src/routes/zen/handler.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloud/app/src/routes/zen/handler.ts b/cloud/app/src/routes/zen/handler.ts index 120e4932..83040c27 100644 --- a/cloud/app/src/routes/zen/handler.ts +++ b/cloud/app/src/routes/zen/handler.ts @@ -409,6 +409,7 @@ export async function handler( tx .select({ balance: BillingTable.balance, + paymentMethodID: BillingTable.paymentMethodID, monthlyLimit: BillingTable.monthlyLimit, monthlyUsage: BillingTable.monthlyUsage, timeMonthlyUsageUpdated: BillingTable.timeMonthlyUsageUpdated, @@ -418,6 +419,7 @@ export async function handler( .then((rows) => rows[0]), ) + if (!billing.paymentMethodID) throw new CreditsError("No payment method") if (billing.balance <= 0) throw new CreditsError("Insufficient balance") if ( billing.monthlyLimit &&