summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFrank <[email protected]>2025-09-24 21:26:04 -0400
committerFrank <[email protected]>2025-09-24 21:26:04 -0400
commit8f90497fc4c76dfcf19937c008e69f31026ed24d (patch)
tree47056d68870c466ab38ae952ae7fe85b4ef8862b
parent9659efca4646f1a752ca173e9a4601b8bffa7ddb (diff)
downloadopencode-8f90497fc4c76dfcf19937c008e69f31026ed24d.tar.gz
opencode-8f90497fc4c76dfcf19937c008e69f31026ed24d.zip
zen: billing
-rw-r--r--packages/console/app/src/routes/stripe/webhook.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/console/app/src/routes/stripe/webhook.ts b/packages/console/app/src/routes/stripe/webhook.ts
index 009a525c7..a9f575976 100644
--- a/packages/console/app/src/routes/stripe/webhook.ts
+++ b/packages/console/app/src/routes/stripe/webhook.ts
@@ -41,12 +41,14 @@ export async function POST(input: APIEvent) {
const workspaceID = body.data.object.metadata?.workspaceID
const customerID = body.data.object.customer as string
const paymentID = body.data.object.payment_intent as string
+ const invoiceID = body.data.object.invoice as string
const amount = body.data.object.amount_total
if (!workspaceID) throw new Error("Workspace ID not found")
if (!customerID) throw new Error("Customer ID not found")
if (!amount) throw new Error("Amount not found")
if (!paymentID) throw new Error("Payment ID not found")
+ if (!invoiceID) throw new Error("Invoice ID not found")
await Actor.provide("system", { workspaceID }, async () => {
const customer = await Billing.get()
@@ -86,6 +88,7 @@ export async function POST(input: APIEvent) {
id: Identifier.create("payment"),
amount: centsToMicroCents(Billing.CHARGE_AMOUNT),
paymentID,
+ invoiceID,
customerID,
})
})