Aiden Cline 2 дней назад
Родитель
Сommit
88ee3dcf55
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      packages/console/app/src/routes/zen/util/handler.ts

+ 2 - 1
packages/console/app/src/routes/zen/util/handler.ts

@@ -762,7 +762,8 @@ export async function handler(
     const billing = authInfo.billing
     const billingUrl = `https://opencode.ai/workspace/${authInfo.workspaceID}/billing`
     const membersUrl = `https://opencode.ai/workspace/${authInfo.workspaceID}/members`
-    if (!billing.paymentMethodID) throw new CreditsError(t("zen.api.error.noPaymentMethod", { billingUrl }))
+    if (billing.balance <= 0 && !billing.paymentMethodID)
+      throw new CreditsError(t("zen.api.error.noPaymentMethod", { billingUrl }))
     if (billing.balance <= 0) throw new CreditsError(t("zen.api.error.insufficientBalance", { billingUrl }))
 
     const now = new Date()