feat: subscription upgrade-only flow, discount codes, proration, enterprise inquiry form, payment history invoices page, fix mobile sidebar close on navigate

This commit is contained in:
egecankomur
2026-05-14 19:09:11 +03:00
parent 37b0928da6
commit 668fb7108b
11 changed files with 666 additions and 75 deletions
+4 -1
View File
@@ -26,7 +26,10 @@ export async function POST(req: Request): Promise<Response> {
return new Response("FAILED", { status: 400 });
}
try {
await activatePlanInDb(tenantId, plan, "paytr", period);
// totalAmount kuruş cinsinden gelir → TRY'ye çevir
const amountTRY = Math.round(Number(totalAmount) / 100);
const orderId = merchantOid;
await activatePlanInDb(tenantId, plan, "paytr", period, { amount: amountTRY, orderId });
} catch (e) {
console.error("[paytr-callback]", e);
return new Response("FAILED", { status: 500 });