summaryrefslogtreecommitdiffhomepage
path: root/cloud
diff options
context:
space:
mode:
authorFrank <[email protected]>2025-09-15 15:53:15 -0400
committerFrank <[email protected]>2025-09-15 15:53:17 -0400
commitbc2e4e23c9565a16ee88e33e23e498f18d67936a (patch)
tree97615020108ba13f90fefcb4cde9a6f22543e0c3 /cloud
parentf5e75606e396e964069e81299cb16602077725c2 (diff)
downloadopencode-bc2e4e23c9565a16ee88e33e23e498f18d67936a.tar.gz
opencode-bc2e4e23c9565a16ee88e33e23e498f18d67936a.zip
wip: zen
Diffstat (limited to 'cloud')
-rw-r--r--cloud/app/src/routes/zen/handler.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/cloud/app/src/routes/zen/handler.ts b/cloud/app/src/routes/zen/handler.ts
index 120e4932b..83040c276 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 &&