This website uses cookies to ensure you get the best experience.

PayFit and our selected partners use cookies and similar technologies (together “cookies”) that are necessary to present this website, and to ensure you get the best experience of it. All the cookies we use are necessary to make the site function - without them, the site wouldn't work.

See our Cookie Policy to read more about the cookies we set.

You can withdraw and manage your consent at any time, by clicking “Manage cookies” at the bottom of each website page.

Marie-Astrid Jehenne

Sales Development Representative

Already working at PayFit?

Let’s recruit together and find your next colleague.

function ask(){ var q = input.value.trim(); if(!q) return; addMsg(q, "user"); input.value=""; var loader = s(document.createElement("div"), { margin:"6px 0", color:"#6B7280", fontStyle:"italic" }); loader.textContent = TXT.thinking; messages.appendChild(loader); messages.scrollTop = messages.scrollHeight; // Ajout de console.log pour suivre l'envoi console.log("DEBUG: Sending GET request to Zapier:", q); var params = new URLSearchParams({ query: q, pageUrl: window.location.href }); var url_with_params = ZAPIER_URL + '?' + params.toString(); fetch(url_with_params, { method:"GET" }) .then(function(r){ console.log("DEBUG: Response received, Status:", r.status); // 1. Vérifier le statut var ct = r.headers.get("content-type") || ""; if (ct.indexOf("application/json") > -1) { return r.json(); } return r.text().then(function(t){ try { return JSON.parse(t); } catch(e){ return { answer: t }; } }); }) .then(function(res){ console.log("DEBUG: Final JSON received:", res); // 2. Vérifier le JSON final messages.removeChild(loader); addMsg((res && res.answer) ? res.answer : TXT.neterr, "bot"); }) .catch(function(error){ console.error("DEBUG: Fetch FAILED completely:", error); // 3. Vérifier les erreurs réseau messages.removeChild(loader); addMsg(TXT.neterr, "bot"); }); }