From efe10a9fc402848fba0eda21c59baed5e30dc368 Mon Sep 17 00:00:00 2001 From: ht Date: Sun, 6 Sep 2026 17:51:46 +0300 Subject: [PATCH] require boolean Stripe cancellation state --- server/billing.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/server/billing.mjs b/server/billing.mjs index 6153098..00e86ce 100644 --- a/server/billing.mjs +++ b/server/billing.mjs @@ -230,6 +230,7 @@ export async function cancelSubscription({ subId, neden, aciklama }) { if (!res.ok) throw new Error(data?.error?.message || `Stripe hatası: HTTP ${res.status}`); if (typeof data.id !== 'string' || !data.id.trim() || typeof data.status !== 'string' || !data.status.trim()) throw new Error('Stripe abonelik iptal yanıtı geçersiz.'); + if (typeof data.cancel_at_period_end !== 'boolean') throw new Error('Stripe iptal durumu geçersiz.'); if (data.cancel_at != null && (!Number.isSafeInteger(data.cancel_at) || data.cancel_at <= 0)) throw new Error('Stripe iptal tarihi geçersiz.'); return {