// checkout.jsx — Payment screen (Desktop + Mobile). Credit card + IBAN tabs. const { useState: _pS, useState } = React; function luhnMask(v) { const digits = v.replace(/\D/g, '').slice(0, 16); return digits.replace(/(.{4})/g, '$1 ').trim(); } function expMask(v) { const d = v.replace(/\D/g, '').slice(0, 4); if (d.length <= 2) return d; return d.slice(0, 2) + '/' + d.slice(2); } function CheckoutCard({ L, lang, listing }) { const l = listing; const subtotal = l.price; const buyerFee = Math.round(subtotal * 0.05); // %5 alıcı komisyonu (escrow + KDV) const total = subtotal + buyerFee; const sellerFee = Math.round(subtotal * 0.05); // %5 satıcı komisyonu (info only) const sellerNet = subtotal - sellerFee; const [method, setMethod] = _pS('card'); const [card, setCard] = _pS({ num: '4242 4242 4242 4242', name: 'SERHAT AKIN', exp: '09/28', cvv: '•••' }); const [installment, setInstallment] = _pS(1); return (
{/* LEFT — method picker + form */}
{/* Method tabs */}
setMethod('card')} icon="tag" title={L.pay_method_card} sub="Visa · Mastercard · Troy"/> setMethod('iban')} icon="shield" title={L.pay_method_iban} sub="Anlık · masrafsız"/>
{method === 'card' ? (
{/* Visual card preview */}
instasatis · secure
{card.num || '•••• •••• •••• ••••'}
CARD HOLDER
{card.name || '—'}
EXPIRES
{card.exp || '••/••'}
setCard({ ...card, num: luhnMask(e.target.value) })} inputMode="numeric"/>
setCard({ ...card, name: e.target.value.toUpperCase() })}/>
setCard({ ...card, exp: expMask(e.target.value) })} placeholder="MM/YY"/>
setCard({ ...card, cvv: e.target.value.replace(/\D/g,'').slice(0,4) })} placeholder="•••"/>
{/* Installments */}
{[1, 3, 6, 9].map(n => { const per = Math.ceil(total / n); return ( ); })}
{L.pay_3d}
) : (
{L.pay_iban_owner}
OKxProject Yazılım A.Ş.
Banka
Garanti BBVA
{L.pay_iban_note}
)}
{/* RIGHT — order summary */}
); } function MethodCard({ active, onClick, icon, title, sub }) { return ( ); } function Label({ children }) { return
{children}
; } function SumRow({ label, value, big }) { return (
{label} {value}
); } // Detaylı komisyon kırılımı — alıcı ödeyecek function FeeBreakdownRow({ lang, buyerFee }) { const [open, setOpen] = useState(false); return (
{open && (
{lang === 'tr' ? 'Escrow / emanet hesap' : 'Escrow holding'}
{lang === 'tr' ? 'KDV dahil işlem ücreti' : 'Transaction fee (incl. VAT)'}
{lang === 'tr' ? '7 gün koşulsuz iade garantisi' : '7-day money-back guarantee'}
{lang === 'tr' ? '7/24 destek + uyuşmazlık arabuluculuğu' : '24/7 support + dispute mediation'}
)}
); } // Satıcı net bilgisi — info only (alıcı görür ki şeffaflık olsun) function SellerNetInfo({ lang, sellerNet, sellerFee }) { return (
{lang === 'tr' ? 'Satıcıya geçecek tutar: ' : 'Seller will receive: '} {fmtPrice(sellerNet, lang)}
{lang === 'tr' ? `İlan tutarından %5 satıcı komisyonu (${fmtPrice(sellerFee, lang)}) düşülür. Devir tamamlanınca ödeme serbest kalır.` : `Listing price minus 5% seller commission (${fmtPrice(sellerFee, lang)}). Released after transfer completes.`}
); } function CheckoutScreen({ L, lang, setLang, theme, listing, onBack, onAuth }) { const l = listing || LISTINGS[0]; return (
{L.nav_explore}

{L.pay_title}

{L.pay_sub}

); } function CheckoutMobile({ L, lang, theme, listing, onBack }) { const l = listing || LISTINGS[0]; const subtotal = l.price; const buyerFee = Math.round(subtotal * 0.05); const total = subtotal + buyerFee; const sellerFee = Math.round(subtotal * 0.05); const sellerNet = subtotal - sellerFee; const [method, setMethod] = _pS('card'); return (
{L.pay_title}
{/* Order summary strip */}
{l.handle}
{fmtNum(l.followers)} {L.card_followers}
{fmtPrice(total, lang)}
{/* Method picker */}
setMethod('card')} icon="tag" title={L.pay_method_card} sub="Visa · MC · Troy"/> setMethod('iban')} icon="shield" title={L.pay_method_iban} sub="Anlık · masrafsız"/>
{/* Form */}
{method === 'card' ? (
instasatis · secure
4242 4242 4242 4242
SERHAT AKIN09/28
{L.pay_3d}
) : (
OKxProject Yazılım A.Ş.
{L.pay_iban_note}
)}
{L.pay_total}
{fmtPrice(total, lang)}
); } Object.assign(window, { CheckoutScreen, CheckoutMobile });