verify Stripe cancellation was scheduled

This commit is contained in:
2026-09-06 17:58:14 +03:00
parent 5cefd915c0
commit f1b283b3d9
+1 -1
View File
@@ -230,7 +230,7 @@ export async function cancelSubscription({ subId, neden, aciklama }) {
if (!res.ok) throw new Error(data?.error?.message || `Stripe hatası: HTTP ${res.status}`); 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()) 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.'); 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_period_end !== true) throw new Error('Stripe abonelik iptalini dönem sonuna planlamadı.');
if (data.cancel_at != null && (!Number.isSafeInteger(data.cancel_at) || data.cancel_at <= 0)) if (data.cancel_at != null && (!Number.isSafeInteger(data.cancel_at) || data.cancel_at <= 0))
throw new Error('Stripe iptal tarihi geçersiz.'); throw new Error('Stripe iptal tarihi geçersiz.');
return { return {