🧪 Teste Script EFI Oficial
⏳ Carregando script EFI oficial...
Número do Cartão:
Validade (MM/AA):
CVV:
Nome do Portador:
🚀 Gerar Token EFI Real
} }; // Aguardar carregamento do script EFI let scriptLoaded = false; let attempts = 0; const maxAttempts = 30; function checkEFIScript() { attempts++; console.log('Tentativa ' + attempts + '/' + maxAttempts + ' - Verificando script EFI...'); if (typeof $gn !== 'undefined' && $gn.ready) { console.log('EFI_SCRIPT_LOADED: true'); console.log('EFI_GN_AVAILABLE:', typeof $gn); console.log('EFI_GN_READY:', typeof $gn.ready); scriptLoaded = true; // Configurar callback para receber o token REAL $gn.done = function(token) { console.log('EFI_CALLBACK_TOKEN:', token); console.log('EFI_CALLBACK_TYPE:', typeof token); console.log('EFI_CALLBACK_LENGTH:', token ? token.length : 'null'); if (token && token.length === 40) { console.log('EFI_CALLBACK_VALID: true'); showResult(`✅ SUCESSO!
Token EFI Real:
${token}
Este token foi gerado pelo script oficial da EFI e será aceito pela API!`, 'success'); } else { console.log('EFI_CALLBACK_VALID: false'); showResult(`❌ Token inválido: ${token}`, 'error'); } }; $gn.ready(function() { console.log('EFI_GN_READY_CALLBACK: executed'); document.getElementById('loading').style.display = 'none'; document.getElementById('form-container').style.display = 'block'; }); } else if (attempts < maxAttempts) { console.log('Script EFI ainda não carregou, aguardando...'); setTimeout(checkEFIScript, 1000); } else { console.log('Script EFI não carregou após 30 segundos'); document.getElementById('loading').style.display = 'none'; document.getElementById('form-container').style.display = 'block'; showResult('❌ Script EFI não carregou. Verifique sua conexão.', 'error'); } } // Iniciar verificação checkEFIScript();