feat(hetzner): update virtualcam with bypassing payments

This commit is contained in:
2026-08-22 14:46:22 +02:00
parent e64c3d1310
commit b80316267f
4 changed files with 40 additions and 60 deletions
@@ -0,0 +1,32 @@
--- a/src/app/api/checkout/route.ts
+++ b/src/app/api/checkout/route.ts
@@ -7,6 +7,8 @@
export const dynamic = "force-dynamic";
+const BYPASS_PAYMENTS = process.env.BYPASS_PAYMENTS === "true";
+
export async function POST(req: Request) {
// Each checkout hits the payment provider, so cap order creation per user
// and per IP to prevent order spam and provider-API abuse.
@@ -86,6 +88,20 @@
const paid = await prisma.order.findUnique({
where: { id: order.id },
include: { license: true },
+ });
+ return NextResponse.json({
+ ok: true,
+ orderId: order.id,
+ licenseKey: paid?.license?.key ?? null,
+ tier: tier.slug,
+ });
+ }
+
+ if (BYPASS_PAYMENTS) {
+ await markOrderPaid({ orderId: order.id, providerRef: "bypass-test" });
+ const paid = await prisma.order.findUnique({
+ where: { id: order.id },
+ include: { license: true },
});
return NextResponse.json({
ok: true,