chore: update iyzico payment processing and database schema
All checks were successful
Deploy / deploy (push) Successful in 9m3s

Enhanced the iyzico payment processing logic by updating the handling of checkout form content. Modified the order schema to include a new field for storing the checkout form content, ensuring it persists across page refreshes. Updated related functions to reflect these changes, improving the overall payment experience. Additionally, updated the app database to incorporate the latest changes.
This commit is contained in:
bilalgursen
2026-08-11 00:51:58 +03:00
parent 08419e6d1c
commit 5ccc9c1ffa
11 changed files with 1137 additions and 4 deletions

View File

@@ -74,7 +74,7 @@ export async function baslatOdeme(
return { error: GENEL_HATA };
}
if (init.status !== "success" || !init.paymentPageUrl || !init.token) {
if (init.status !== "success" || !init.checkoutFormContent || !init.token) {
// initialize aşamasında karta hiç dokunulmaz: buradaki hatalar kart/kullanıcı
// kaynaklı değil, bizim yapılandırmamızdandır (anahtar, üye işyeri ayarı,
// sepet kuralı). iyzico'nun mesajı log'a gider, kullanıcıya genel mesaj.
@@ -92,10 +92,12 @@ export async function baslatOdeme(
return { error: GENEL_HATA };
}
// Form içeriği de saklanır: /odeme/[siparis] sayfası yenilense bile aynı
// token'lı form yeniden gösterilir, ikinci bir initialize gerekmez.
await appDb
.update(schema.orders)
.set({ iyzicoToken: init.token })
.set({ iyzicoToken: init.token, iyzicoFormContent: init.checkoutFormContent })
.where(eq(schema.orders.id, orderId));
redirect(init.paymentPageUrl);
redirect(`/odeme?siparis=${orderId}`);
}