summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src/routes/stripe
diff options
context:
space:
mode:
authorGitHub Action <[email protected]>2025-11-08 01:59:02 +0000
committerGitHub Action <[email protected]>2025-11-08 01:59:02 +0000
commit34ff87d504836ff71b3bb2d466842c00ee3c5ec2 (patch)
treecc8ac777f2f082ff676b179017c7dc0f3270314b /packages/console/app/src/routes/stripe
parent16357e804145b7f96a2a53badb7dcb6c5453dafe (diff)
downloadopencode-34ff87d504836ff71b3bb2d466842c00ee3c5ec2.tar.gz
opencode-34ff87d504836ff71b3bb2d466842c00ee3c5ec2.zip
chore: format code
Diffstat (limited to 'packages/console/app/src/routes/stripe')
-rw-r--r--packages/console/app/src/routes/stripe/webhook.ts23
1 files changed, 5 insertions, 18 deletions
diff --git a/packages/console/app/src/routes/stripe/webhook.ts b/packages/console/app/src/routes/stripe/webhook.ts
index d8d857255..3260f31b2 100644
--- a/packages/console/app/src/routes/stripe/webhook.ts
+++ b/packages/console/app/src/routes/stripe/webhook.ts
@@ -41,8 +41,7 @@ export async function POST(input: APIEvent) {
}
if (body.type === "checkout.session.completed") {
const workspaceID = body.data.object.metadata?.workspaceID
- const amountInCents =
- body.data.object.metadata?.amount && parseInt(body.data.object.metadata?.amount)
+ const amountInCents = body.data.object.metadata?.amount && parseInt(body.data.object.metadata?.amount)
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
@@ -55,8 +54,7 @@ export async function POST(input: APIEvent) {
await Actor.provide("system", { workspaceID }, async () => {
const customer = await Billing.get()
- if (customer?.customerID && customer.customerID !== customerID)
- throw new Error("Customer ID mismatch")
+ if (customer?.customerID && customer.customerID !== customerID) throw new Error("Customer ID mismatch")
// set customer metadata
if (!customer?.customerID) {
@@ -72,8 +70,7 @@ export async function POST(input: APIEvent) {
expand: ["payment_method"],
})
const paymentMethod = paymentIntent.payment_method
- if (!paymentMethod || typeof paymentMethod === "string")
- throw new Error("Payment method not expanded")
+ if (!paymentMethod || typeof paymentMethod === "string") throw new Error("Payment method not expanded")
await Database.transaction(async (tx) => {
await tx
@@ -128,12 +125,7 @@ export async function POST(input: APIEvent) {
amount: PaymentTable.amount,
})
.from(PaymentTable)
- .where(
- and(
- eq(PaymentTable.paymentID, paymentIntentID),
- eq(PaymentTable.workspaceID, workspaceID),
- ),
- )
+ .where(and(eq(PaymentTable.paymentID, paymentIntentID), eq(PaymentTable.workspaceID, workspaceID)))
.then((rows) => rows[0]?.amount),
)
if (!amount) throw new Error("Payment not found")
@@ -144,12 +136,7 @@ export async function POST(input: APIEvent) {
.set({
timeRefunded: new Date(body.created * 1000),
})
- .where(
- and(
- eq(PaymentTable.paymentID, paymentIntentID),
- eq(PaymentTable.workspaceID, workspaceID),
- ),
- )
+ .where(and(eq(PaymentTable.paymentID, paymentIntentID), eq(PaymentTable.workspaceID, workspaceID)))
await tx
.update(BillingTable)