> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tahsilat.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gereksinimler ve Uyumluluk

> Modern ödeme altyapısı için güçlü ve esnek API çözümü

### Tarayıcı Desteği

SDK'nın sorunsuz çalışması için aşağıdaki minimum tarayıcı versiyonları gereklidir:

| Tarayıcı         | Minimum Versiyon | Yayın Yılı |
| :--------------- | :--------------- | :--------- |
| Chrome           | 60+              | 2017       |
| Firefox          | 55+              | 2017       |
| Safari           | 11+              | 2017       |
| Edge             | 79+              | 2020       |
| iOS Safari       | 11+              | 2017       |
| Android Chrome   | 60+              | 2017       |
| Opera            | 47+              | 2017       |
| Samsung Internet | 7.2+             | 2017       |

<Warning>
  Internet Explorer hiçbir versiyonunda desteklenmemektedir. IE kullanan müşterileriniz için alternatif ödeme yöntemleri sunmanızı öneririz.
</Warning>

### JavaScript Özellikleri

SDK aşağıdaki modern JavaScript özelliklerini kullanır:

* **ECMAScript 2017 (ES8)** ve üzeri
* `async/await` desteği
* `Promise` API
* `fetch` API
* `Object.entries()`, `Object.assign()`
* Arrow functions
* Template literals
* Destructuring
* Spread operator (`...`)
* `Map` ve `WeakSet` yapıları

### Ağ Gereksinimleri

* **HTTPS Zorunluluğu**: Production ortamında (`pk_live_` anahtarları ile) HTTPS bağlantısı zorunludur
* **WebSocket**: Gerçek zamanlı iletişim için WebSocket desteği (opsiyonel)
* **CORS**: Cross-Origin Resource Sharing desteği

## Uyumluluk Kontrolleri

### Tarayıcı Desteği Kontrolü

Kullanıcının tarayıcısının SDK'yı destekleyip desteklemediğini kontrol etmek için:

```javascript theme={null}
function checkBrowserCompatibility() {
    // Modern JavaScript özellikleri kontrolü
    const checks = {
        promise: typeof Promise !== 'undefined',
        fetch: typeof fetch !== 'undefined',
        async: (function() {
            try {
                new Function('async () => {}')();
                return true;
            } catch (e) {
                return false;
            }
        })(),
        objectEntries: typeof Object.entries === 'function',
        arrow: (function() {
            try {
                eval('() => {}');
                return true;
            } catch(e) {
                return false;
            }
        })(),
        spread: (function() {
            try {
                eval('let a = {...{}}');
                return true;
            } catch(e) {
                return false;
            }
        })()
    };

    // Tüm kontrolleri geç
    const isCompatible = Object.values(checks).every(check => check === true);

    if (!isCompatible) {
        console.error('Tarayıcı uyumluluk kontrolleri:', checks);
    }

    return isCompatible;
}

// Kullanım
if (!checkBrowserCompatibility()) {
    // Uyumluluk uyarısı göster
    document.getElementById('payment-container').innerHTML = `
        <div class="alert alert-warning">
            <h3>Tarayıcınız Desteklenmiyor</h3>
            <p>Güvenli ödeme yapabilmek için lütfen tarayıcınızı güncelleyin.</p>
            <p>Önerilen tarayıcılar: Chrome, Firefox, Safari, Edge</p>
        </div>
    `;
} else {
    // SDK'yı yükle
    const script = document.createElement('script');
    script.src = 'https://js.tahsilat.com/v1/tahsilat.js';
    document.head.appendChild(script);
}
```

## Bilinen Uyumluluk Sorunları

### 1. Eski Tarayıcılar

<Warning>
  Aşağıdaki tarayıcılar/versiyonlar desteklenmemektedir:

  * Internet Explorer (tüm versiyonlar)
  * Chrome 59 ve öncesi
  * Firefox 54 ve öncesi
  * Safari 10 ve öncesi
  * Eski Android Browser (Android 4.4 ve öncesi)
</Warning>

## Polyfill Çözümleri

Eski tarayıcıları desteklemek için polyfill kullanabilirsiniz:

### Otomatik Polyfill (Önerilen)

```html theme={null}
<!-- Polyfill.io otomatik olarak eksik özellikleri algılar ve yükler -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=Promise,fetch,Object.entries,Object.assign,Array.from,Symbol,Map,WeakSet"></script>

<!-- Async/await için regenerator runtime -->
<script src="https://cdn.jsdelivr.net/npm/regenerator-runtime@0.13.9/runtime.min.js"></script>

<!-- SDK -->
<script src="https://js.tahsilat.com/v1/tahsilat.js"></script>
```

### Manuel Polyfill

```javascript theme={null}
// Promise polyfill
if (!window.Promise) {
    document.write('<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"><\/script>');
}

// Fetch polyfill
if (!window.fetch) {
    document.write('<script src="https://unpkg.com/whatwg-fetch@3.6.2/dist/fetch.umd.js"><\/script>');
}

// Object.entries polyfill
if (!Object.entries) {
    Object.entries = function(obj) {
        var ownProps = Object.keys(obj),
            i = ownProps.length,
            resArray = new Array(i);
        while (i--)
            resArray[i] = [ownProps[i], obj[ownProps[i]]];
        return resArray;
    };
}
```

## Graceful Degradation Stratejisi

SDK yüklenemediğinde alternatif çözüm sunun:

```javascript theme={null}
class TahsilatFallback {
    constructor() {
        this.checkInterval = setInterval(() => {
            this.checkSDK();
        }, 1000);

        // 10 saniye sonra timeout
        setTimeout(() => {
            if (!window.TahsilatSDK) {
                this.showFallback();
                clearInterval(this.checkInterval);
            }
        }, 10000);
    }

    checkSDK() {
        if (window.TahsilatSDK) {
            clearInterval(this.checkInterval);
            this.initializeSDK();
        }
    }

    initializeSDK() {
        const tahsilat = new TahsilatSDK('pk_test_xxx');
        // Normal SDK kullanımı
    }

    showFallback() {
        document.getElementById('payment-container').innerHTML = `
            <div class="fallback-payment">
                <h3>Alternatif Ödeme Yöntemi</h3>
                <p>Otomatik ödeme sistemi yüklenemedi.</p>
                <a href="/manual-payment" class="btn btn-primary">
                    Manuel Ödeme Sayfasına Git
                </a>
            </div>
        `;
    }
}

// Başlat
new TahsilatFallback();
```

## Sorun Giderme

### SDK Yüklenmeme Sorunları

```javascript theme={null}
// Detaylı hata yakalama
window.addEventListener('error', function(e) {
    if (e.filename && e.filename.includes('tahsilat.js')) {
        console.error('Tahsilat SDK Hatası:', {
            message: e.message,
            filename: e.filename,
            lineno: e.lineno,
            colno: e.colno
        });

        // Kullanıcıya bilgi ver
        alert('Ödeme sistemi yüklenirken bir hata oluştu. Lütfen sayfayı yenileyin.');
    }
});
```

<Note>
  Herhangi bir uyumluluk sorunu yaşarsanız, lütfen tarayıcı ve versiyon bilgilerinizle birlikte destek ekibimize başvurun.
</Note>
