'use client'; import React, { useState } from 'react'; import { useRouter, useParams } from 'next/navigation'; import { ShieldCheck, ArrowRight, Lock, Building2 } from 'lucide-react'; export default function MerchantLoginPage() { const [apiKey, setApiKey] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); const router = useRouter(); const params = useParams(); const id = params.id as string; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsLoading(true); setError(''); try { // We use an API route to verify the key and set a cookie const response = await fetch(`/api/merchants/auth`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ identifier: id, apiKey }) }); const data = await response.json(); if (response.ok) { router.push(`/merchant/${id}`); router.refresh(); } else { setError(data.error || 'Geçersiz anahtar.'); } } catch (err) { setError('Bir hata oluştu. Lütfen tekrar deneyin.'); } finally { setIsLoading(false); } }; return (

Firma Girişi

P2CGateway Güvenli Erişim Paneli

Yönetim anahtarınızı girin

Size özel tanımlanan API Secret Key ile giriş yapın.

setApiKey(e.target.value)} placeholder="••••••••••••••••" className="w-full pl-14 pr-6 py-4 bg-gray-50 border-2 border-transparent focus:border-blue-500 focus:bg-white rounded-[24px] outline-none transition-all font-mono font-bold text-gray-900" />
{error &&

{error}

}
SSL 256-bit Uçtan Uca Şifreleme
); }