Frank 5 месяцев назад
Родитель
Сommit
c1d754bec9
2 измененных файлов с 1 добавлено и 4 удалено
  1. 0 1
      cloud/app/src/routes/stripe/webhook.ts
  2. 1 3
      cloud/core/src/billing.ts

+ 0 - 1
cloud/app/src/routes/stripe/webhook.ts

@@ -24,7 +24,6 @@ export async function POST(input: APIEvent) {
     if (!workspaceID) throw new Error("Workspace ID not found")
     if (!workspaceID) throw new Error("Workspace ID not found")
     if (!customerID) throw new Error("Customer ID not found")
     if (!customerID) throw new Error("Customer ID not found")
     if (!amount) throw new Error("Amount not found")
     if (!amount) throw new Error("Amount not found")
-    if (amount !== 2118) throw new Error("Amount mismatch")
     if (!paymentID) throw new Error("Payment ID not found")
     if (!paymentID) throw new Error("Payment ID not found")
 
 
     const chargedAmount = 2000
     const chargedAmount = 2000

+ 1 - 3
cloud/core/src/billing.ts

@@ -4,8 +4,6 @@ import { BillingTable, PaymentTable, UsageTable } from "./schema/billing.sql"
 import { Actor } from "./actor"
 import { Actor } from "./actor"
 import { fn } from "./util/fn"
 import { fn } from "./util/fn"
 import { z } from "zod"
 import { z } from "zod"
-import { Identifier } from "./identifier"
-import { centsToMicroCents } from "./util/price"
 import { User } from "./user"
 import { User } from "./user"
 import { Resource } from "@opencode/cloud-resource"
 import { Resource } from "@opencode/cloud-resource"
 
 
@@ -72,7 +70,7 @@ export namespace Billing {
               product_data: {
               product_data: {
                 name: "opencode credits",
                 name: "opencode credits",
               },
               },
-              unit_amount: 2118, // $20 minimum + Stripe fee 4.4% + $0.30
+              unit_amount: 2123, // $20 minimum + Stripe fee 4.4% + $0.30
             },
             },
             quantity: 1,
             quantity: 1,
           },
           },