1$(document).ready(function () { 2 if ($("#qrcode_identity_820").length > 0) { 3 var qrCodeRefreshInterval = null; 4 5 const IPLevels = ["IP1", "IP1 PLUS", "IP2", "IP2 PLUS", "IP3", "IP 3PLUS"] 6 7 const container = $("#qrcode_identity_820"); 8 const socket = io("https://customer.ratifyid.com:8080", { 9 path: "/socket.io/", 10 transports: ["websocket"], 11 }); 12 13 socket.emit("qr-idshare", { widgetId: "664f06eb2175c2862200b68c" }); 14 15 socket.on("qr-idshare-response", (data) => { 16 if (data && typeof data.token == "string") { 17 const qrCodeContainer = document.getElementById("qrcode-canvas"); 18 qrCodeContainer.innerHTML = ""; 19 $('.qrcode-loader').hide(); 20 const qrCode = new QRCodeStyling({ 21 width: 220, 22 height: 220, 23 data: data.token, 24 dotsOptions: { 25 color: "#000000", 26 type: "rounded" 27 }, 28 backgroundOptions: { 29 color: "#ffffff", 30 }, 31 cornersSquareOptions: { 32 type: "extra-rounded", 33 color: "#0097dc", 34 }, 35 cornersDotOptions: { 36 type: "dot", 37 color: "#4face3" 38 }, 39 imageOptions: { 40 crossOrigin: "anonymous", 41 margin: 40 42 } 43 }); 44 qrCode.append(document.getElementById("qrcode-canvas")); 45 } 46 }); 47 48 socket.on("idShareSuccess", (data) => { 49 if (typeof data !== "undefined" && Object.keys(data).length > 0) { 50 $('.qrcode-loader').hide(); 51 show_details(data); 52 clearInterval(qrCodeRefreshInterval); 53 } 54 }); 55 56 socket.on("idRequestFail", (data) => { 57 console.log("idRequestFail", data); 58 }); 59 60 socket.on("idRequestError", (data) => { 61 console.log("idRequestError", data); 62 }); 63 64 function formatDate(inputDate) { 65 if (typeof inputDate === 'string' && inputDate.length > 0) { 66 try { 67 const dateObject = new Date(inputDate); 68 return dateObject.toLocaleDateString('en-GB'); 69 } catch (err) { 70 console.log("err", err); 71 return '-'; 72 } 73 } 74 } 75 76 function setQRCodeRefreshRate() { 77 qrCodeRefreshInterval = setInterval(function () { 78 socket.emit("qr-idshare", { widgetId: "664f06eb2175c2862200b68c" }); 79 }, 60000); 80 } 81 82 function show_details(data) { 83 const user = data.user; 84 const identity_level = IPLevels[user.identityLevel] ?? "N/A"; 85 86 container.find(".qrcode-canvas").hide(); 87 container.find(".qrcode-result").empty().show(); 88 89 var html = $(`<div class="identity-container"> 90 <h3 class="user-name">${user.firstName} ${user.middleNames ? user.middleNames : ''} ${user.lastName ? user.lastName : ''}</h3> 91 <h3 class="iplevel">IP Level: ${identity_level}</h3> 92 <div class="user-info"> 93 <div class="id-row" style="margin-bottom: 15px;"> 94 <label class="id-label">Email:</label> 95 <span>${user.email}</span> 96 <label class="id-label">Phone:</label> 97 <span>${user.phone ? user.phone : '-'}</span> 98 <label class="id-label">Date of Birth:</label> 99 <span>${user.dateOfBirth ? formatDate(user.dateOfBirth) : '-'}</span> 100 </div> 101 <div class="id-row"> 102 <label class="id-label">Verified Documents:</label> 103 </div> 104 <div class="documents-list"></div> 105 </div> 106 </div>`); 107 108 if (typeof data.documents !== "undefined" && data.documents.length > 0) {
109 data.documents.forEach(element => { 110 $(`<h3 class="id-label">${element.documentName}</h3>`).appendTo(html.find(".documents-list")); 111 }); 112 } else { 113 $(`<p style="color: red;">No documents available.</p>`).appendTo(html.find(".documents-list")) 114 } 115 116 html.appendTo(container.find(".qrcode-result")); 117 } 118 119 setQRCodeRefreshRate(); 120 } 121});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.