refactor(odeme): update environment variable usage and documentation
All checks were successful
Deploy / deploy (push) Successful in 8m39s

Replaced `NEXT_PUBLIC_APP_URL` with `APP_URL` in the payment processing logic to ensure proper runtime access. Updated related documentation to clarify the distinction between build-time and runtime environment variables, emphasizing the importance of using `APP_URL` for callback and webhook URLs. Adjusted references in the codebase to reflect this change, enhancing clarity and functionality in the payment flow.
This commit is contained in:
bilalgursen
2026-08-11 11:42:47 +03:00
parent d03ba91bf0
commit 951caa3c93
6 changed files with 47 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
import { eq } from "drizzle-orm";
import { NextResponse, type NextRequest } from "next/server";
import { appUrl as siteKok } from "@/lib/app-url";
import { appDb, schema } from "@/lib/appdb";
import { odemeyiSonuclandir } from "@/lib/odeme";
@@ -11,7 +12,7 @@ import { odemeyiSonuclandir } from "@/lib/odeme";
// SameSite=Lax nedeniyle session çerezi GELMEZ — kullanıcı token'dan çözülür,
// verifySession ÇAĞRILMAZ. Kredi tanımlama odemeyiSonuclandir içinde idempotenttir.
export async function POST(request: NextRequest) {
const appUrl = process.env.NEXT_PUBLIC_APP_URL ?? "http://localhost:3000";
const appUrl = siteKok();
let token: string | undefined;
try {