Pencilton introduces contactless RuPay card in the form of keychain

By | April 29, 2022


Pencilton, a teen-focused fintech startup, has launched PencilKey, a National Common Mobility Card (NCMC) compliant RuPay contactless keychain, in partnership with the National Payments Corporation of India (NPCI) and Transcorp. Users can activate and manage their PencilKey through the Pencilton app which is also used to load money, check spends, block/unblock the account, set limits, etc.

Buy Prime Test Series for all Banking, SSC, Insurance & other exams

Key points:

  • PencilKey is linked to the PencilCard which is an all-in-one prepaid card, metro card, and bus card. PencilKey is equipped with the benefits of NCMC which works at the Delhi Airport Metro line and Goa’s buses currently.
  • It is also scheduled to be accepted for metro travel in Pune, Chennai & Mumbai as well as in BEST buses in Mumbai. According to Pencilton, the virtual PencilCard comes for free.
  • Users can buy their PencilKey for ₹150 and PencilCard for ₹100, but as part of the company’s launch offer, users can also buy a PencilKit (combo) which includes both PencilCard and PencilKey for ₹200.

Find More Business News Here

Pencilton introduces contactless RuPay card in the form of keychain_60.1

window.handleEmailOnchange = function () { document.getElementById('loginEmailError').innerText=""; }

window.loginPasswordBlur = function (value) { if (!value.length) { document.getElementById('loginPasswordError').innerText="Please enter a valid password"; } }

window.handlePasswordOnchange = function () { document.getElementById('loginPasswordError').innerText=""; }

window.showLoginModalWithValuesReset = function () { var blogName = document.location.hostname.replace('.com',''); ga('send', 'event', { eventCategory: 'website:'+blogName, eventAction: ' Clicked through header', eventLabel: 'Signup button clicked' });

document.getElementById('loginModal').style.display = "block"; document.getElementsByTagName('body')[0].classList.add('no-overflow'); document.getElementById('loginModal').style.display = 'block'; document.getElementById('loginEmail').value=""; document.getElementById('loginPassword').value=""; document.getElementById('loginEmailError').innerText=""; document.getElementById('loginPasswordError').innerText=""; document.getElementById('login-error-message').innerText=""; document.getElementById('newPassword').value=""; document.getElementById('reEnterPassword').value=""; document.getElementById('showPasswordResetModal').style.display = 'none'; document.getElementById('inputOTPModal').style.display = 'none'; document.getElementById('userEmailForOtp').value=""; document.getElementById('otpButtonLoader').style.display = 'none'; document.getElementById('otpInput').value=""; document.getElementById('submitButtonTextOtp').style.display = 'block'; resetSignUpForm(); clearSignUpFormErrors(); }

window.getCookie = function (name) { let nameEQ = name + "="; let ca = document.cookie.split(';'); for (let i = 0; i < ca.length; i++) { let c = ca[i]; while (c.charAt(0) === ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); } return null; } window.showForgotPasswordScreen = function () { document.getElementById('loginModal').style.display = 'none'; document.getElementById('userEmailForOtp').value=""; document.getElementById('inputOTPModal').style.display = 'none'; document.getElementById('sendOtpForPasswordReset').style.display = 'block'; document.getElementById('otpButtonLoader').style.display = 'none'; document.getElementById('submitButtonTextOtp').style.display = 'block'; } window.changeLoginPassword = function () { var rePassword = document.getElementById('reEnterPassword').value; var newPassword = document.getElementById('newPassword').value; if (newPassword.length && rePassword) { if (newPassword.length < 6 || newPassword.length > 20) { document.getElementById('resetPasswordError').innerText="Password Should be between 6 and 20 characters"; return false; } } if(newPassword === rePassword){ document.getElementById('passwordResetButtonLoader').style.display = 'block'; document.getElementById('changePasswordText').style.display = 'none'; const data = { email: document.getElementById('userEmailForOtp').value, otp: document.getElementById('otpInput').value, providerName: "email", sec: newPassword }; postDataToServer(USER_API_URL+'register', data);

} else{ document.getElementById('resetPasswordError').innerText="Password do not match."; }

}

window.showResendEmailModal = function () { document.getElementById('loginModal').style.display = 'none'; document.getElementById('sendOtpForPasswordReset').style.display = 'block'; document.getElementById('currentPasswordLength').innerHTML = '0'; }

window.verifyOTP = function () { // check here document.getElementById('login-error-message-otp').style.display = 'none'; const otpValue = document.getElementById('otpInput').value; document.getElementById('currentPasswordLength').innerHTML = otpValue.length; if (otpValue.length === 6) { const otpInputNode = document.getElementById('otpInput'); otpInputNode.setAttribute('disabled', true); otpInputNode.classList.add("custom-disabled"); const data = { email: document.getElementById('userEmailForOtp').value, otp: otpValue }; postDataToServer(USER_API_URL+'verifyOTP', data) } }

// This function is called when someone finishes with the Login // Button. See the onlogin handler attached to it in the sample // code below. window.checkLoginState = function () {

try{ FB.getLoginStatus(function (response) { statusChangeCallback(response); }); }catch(ex){ statusChangeCallback();

}

}

window.fbAsyncInit = function () { FB.init({ appId: '233923120281900', cookie: true, // enable cookies to allow the server to access // the session xfbml: true, // parse social plugins on this page version: 'v3.2' // The Graph API version to use for the call });

// Now that we've initialized the JavaScript SDK, we call // FB.getLoginStatus(). This function gets the state of the // person visiting this page and can return one of three states to // the callback you provide. They can be: // // 1. Logged into your app ('connected') // 2. Logged into Facebook, but not your app ('not_authorized') // 3. Not logged into Facebook and can't tell if they are logged into // your app or not. // // These three cases are handled in the callback function. // };

// Load the SDK asynchronously (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));

// Here we run a very simple test of the Graph API after login is // successful. See statusChangeCallback() for when this call is made. function testAPI(data) {

FB.api('/me', 'get', { access_token: data.accessToken, fields: 'id,name,gender,email' }, function (response) { });

FB.api('/me?fields=name,email', function (response) { // call adda247-register api const userDetails = { email: response.email, name: response.name, providerName: "f", providerToken: data.accessToken, providerUserId: data.userID, }; registerOrLoginUser(userDetails); ga('send', 'event', { eventCategory: 'Login Method', eventAction: 'Facebook', eventLabel: 'Signin' }); }); } // This is called with the results from from FB.getLoginStatus(). window.statusChangeCallback = function (response) { // The response object is returned with a status field that lets the // app know the current login status of the person. // Full docs on the response object can be found in the documentation // for FB.getLoginStatus(). if (response.status === 'connected') { // Logged into your app and Facebook. testAPI(response.authResponse); } else { FB.login(function(response){ if(response.status === 'connected'){ statusChangeCallback(response); }

}); } }

window.onSignIn = function (googleUser) { var googleIdToken = googleUser.getAuthResponse().id_token; var profile = googleUser.getBasicProfile(); googleUser.disconnect() // call adda247-register api const userDetails = { email: profile.getEmail(), name: profile.getName(), providerName: "g", providerToken: googleIdToken, providerUserId: profile.getId(), }; registerOrLoginUser(userDetails); setTimeout(function(){ var lableType; var loginUserType = getCookie('cp_user_type'); if($.trim(loginUserType) === "Old"){ lableType="Signin"; } else{ lableType="Signup"; } ga('send', 'event', { eventCategory: 'Login Method', eventAction: 'Google', eventLabel: lableType }); }, 2000); }

// Get the modal var loginModal = document.getElementById('loginModal');

const signUpModal = document.getElementById('signUpModal');

// When the user clicks anywhere outside of the modal, close it window.onclick = function (event) { if (event.target === loginModal) { loginModal.style.display = 'none'; document.getElementsByTagName('body')[0].classList.remove('no-overflow');

} }

document.onkeydown = function (evt) { evt = evt || window.event; var isEscape = false; if ('key' in evt) { isEscape = (evt.key === 'Escape' || evt.key === 'Esc'); } else { isEscape = (evt.keyCode === 27); } if (isEscape) { loginModal.style.display = 'none'; document.getElementsByTagName('body')[0].classList.remove('no-overflow'); signUpModal.style.display = 'none'; } };

window.showLoginModal = function () { document.getElementById('sendOtpForPasswordReset').style.display = 'none'; document.getElementById('loginModal').style.display = 'block'; document.getElementById('signUpModal').style.display = 'none'; document.getElementById('login-error-message').innerText=""; }

window.showSignUpmodal = function () { document.getElementById('loginModal').style.display = 'none'; document.getElementById('signUpModal').style.display = 'block'; }

window.showSignUpForm = function () { document.getElementById('sign-up-email-button').style.display = 'none'; document.getElementById('signUpForm').style.display = 'block'; clearSignUpFormErrors(); }

window.showLoader = function () { document.getElementById('submitButtonText').style.display = 'none'; document.getElementById('buttonLoader').style.display = 'block'; }

window.showSignupLoader = function () { document.getElementById('submitSignUpButtonText').style.display = 'none'; document.getElementById('signUpButtonLoader').style.display = 'block'; }

window.hideLoader = function () { document.getElementById('submitButtonText').style.display = 'block'; document.getElementById('buttonLoader').style.display = 'none'; document.getElementById('passwordResetButtonLoader').style.display = 'none'; document.getElementById('submitSignUpButtonText').style.display = 'block'; document.getElementById('signUpButtonLoader').style.display = 'none'; document.getElementById('changePasswordText').style.display = 'block';

// document.getElementById('buttonLoader-1').style.display = 'none'; }

window.registerOrLoginUser = function (data) { const url = USER_API_URL+'register'; postDataToServer(url, data);

}

window.clearErrors = function () { document.getElementById('loginEmailError').innerText=""; document.getElementById('loginPasswordError').innerText=""; }

window.submitLoginDetails = function () { clearErrors(); const emailForLogin = document.getElementById('loginEmail').value; const passwordForLogin = document.getElementById('loginPassword').value;

if (!validateEmail(emailForLogin)) { document.getElementById('loginEmailError').innerText="Please enter a valid email"; return; }

if (!passwordForLogin.length) { document.getElementById('loginPasswordError').innerText="Please enter a password"; return; }

if (validateEmail(emailForLogin)) { showLoader(); const data = { email: emailForLogin, providerName: "email", sec: passwordForLogin }; const url = USER_API_URL+'login'; document.cookie = "cp_user_type=Old"; $("#adda247_lead_form_userType").val('Old');

postDataToServer(url, data); if($("#comment").val()){ $('#submit').trigger("click");

}

var cookieval = $.cookie("cp_user_email"); if ($("#star_value").val() > 0 && cookieval) { var valu_s = $("#star_value").val(); console.log(".st"+ valu_s,'dgshfjkhfdskjlhglk'); $('#open-modal').css('visibility','visible').css('opacity',1); for(var i=0;i<=valu_s;i++){ $("#popup-star"+valu_s).attr("checked", 'checked'); var selete = $("#rating_change").val(); $(".rating-text").text( selete ); changecheckbox(valu_s); } } ga('send', 'event', { eventCategory: 'Login Method', eventAction: 'Email', eventLabel: 'Signin' }); } } window.clearSignUpFormErrors = function () { document.getElementById('signUpEmailError').innerText=""; document.getElementById('signUpNameError').innerText=""; document.getElementById('signUpPasswordError').innerText=""; document.getElementById('signUpReEnterPasswordError').innerText=""; document.getElementById('signup-error-message').innerText=""; } window.verifySignUpEmail = function (email) { if (!validateEmail(email)) { document.getElementById('signUpEmailError').innerText="Please enter a valid email"; return false; } } window.verifySignUpName = function (name) { var format = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/; if (format.test(name)) { document.getElementById('signUpNameError').innerText="Please enter a valid name"; return false; } return true; }

window.signUpEmailBlur = function (email) { verifySignUpEmail(email); }

window.signUpNameBlur = function (name) { verifySignUpName(name); }

window.handleGenericOnchange = function (id) { document.getElementById(id).innerText=""; }

window.newSignUp = function () { clearSignUpFormErrors(); const emailForSignup = document.getElementById('signUpEmail').value;

const nameForSignup = document.getElementById('signUpName').value; const passwordForSignUp = document.getElementById('signUpPassword').value; const passwordReEnterValue = document.getElementById('signUpReEnterPassword').value;

//check for empty fields if (!emailForSignup || !nameForSignup || !passwordForSignUp || !passwordReEnterValue) { if (!emailForSignup) { document.getElementById('signUpEmailError').innerText="Please Enter a valid email"; } if (!nameForSignup) { document.getElementById('signUpNameError').innerText="Please enter a valid name"; } if (!passwordForSignUp) { document.getElementById('signUpPasswordError').innerText="Please enter a password";

} if (!passwordReEnterValue) { document.getElementById('signUpReEnterPasswordError').innerText="Please re-enter the password";

} return false } if (emailForSignup.length > 0) { if (!validateEmail(emailForSignup)) { document.getElementById('signUpEmailError').innerText="Please Enter a valid email"; return false; } } if (nameForSignup.length) { if (!verifySignUpName(nameForSignup)) { document.getElementById('signUpNameError').innerText="Please Enter a valid name"; return false; } } if (passwordForSignUp.length) { if (passwordForSignUp.length < 6 || passwordForSignUp.length > 20) { document.getElementById('signUpPasswordError').innerText="Password Should be between 6 and 20 characters"; return false; } } if (passwordForSignUp !== passwordReEnterValue) { document.getElementById('signUpReEnterPasswordError').innerText="Passwords do not match"; return false; } showSignupLoader(); //send data to server for new registration const data = { email: emailForSignup, name: nameForSignup, providerName: "email", sec: passwordForSignUp }; const url = USER_API_URL+'register'; postDataToServer(url, data) document.cookie = "cp_user_type=New"; $("#adda247_lead_form_userType").val('New'); ga('send', 'event', { eventCategory: 'Login Method', eventAction: 'Email', eventLabel: 'Signup' }); }

window.submitResetPasswordEmail = function () { document.getElementById('invalidEmailForResetPassword').innerText="";

if (validateEmail(document.getElementById('userEmailForOtp').value)) { document.getElementById('submitButtonTextOtp').style.display = 'none'; document.getElementById('otpButtonLoader').style.display = 'block';

showLoader(); const emailForOTP = document.getElementById('userEmailForOtp').value; const verifyEmailUrl = USER_API_URL+'forgotPassword?emailId=' + emailForOTP; getDataFromServer(verifyEmailUrl, () => { }); return; } document.getElementById('invalidEmailForResetPassword').innerText="Please enter a valid email"; }

window.handleEmailForOTP = function () { document.getElementById('invalidEmailForResetPassword').innerText=""; }

/*Phone Number otp start*/

window.closePhonenumberPopup = function () { document.getElementById('skipPhoneNumber').style.display = 'block'; //document.getElementById('enterPhoneNumber').style.display = 'none'; } window.skipPhonenumberPopup = function () { document.getElementById('skipPhoneNumber').style.display = 'none'; document.getElementById('enterPhoneNumber').style.display = 'none'; ga('send', 'event', { eventCategory: 'Cross button Mobile OTP', eventAction: 'Skipped', eventLabel: 'Phone Verified Skip' }); if($("#comment").val()){ $('#submit').trigger("click");

} var cookieval = $.cookie("cp_user_email"); console.log('cookieval',cookieval); if ($("#star_value").val() > 0 && cookieval) { var valu_s = $("#star_value").val(); console.log(".st"+ valu_s,'dgshfjkhfdskjlhglk'); $('#open-modal').css('visibility','visible').css('opacity',1); for(var i=0;i<=valu_s;i++){ $("#popup-star"+valu_s).attr("checked", 'checked'); var selete = $("#rating_change").val(); $(".rating-text").text( selete ); changecheckbox(valu_s); } } } window.skipOTPPopup = function () { document.getElementById('phoneInputOTPModal').style.display = 'none'; document.getElementById('skipOTPNumber').style.display = 'none'; ga('send', 'event', { eventCategory: 'Cross button Mobile OTP', eventAction: 'Skipped', eventLabel: 'OTP Verified Skip' }); } window.proceedOTPPopup = function () { document.getElementById('skipOTPNumber').style.display = 'none'; ga('send', 'event', { eventCategory: 'Cross button Mobile OTP', eventAction: 'Not Skipped', eventLabel: 'OTP Verified Not Skip' }); } window.proceedPhonenumberPopup = function () { document.getElementById('skipPhoneNumber').style.display = 'none'; ga('send', 'event', { eventCategory: 'Cross button Mobile OTP', eventAction: 'Not Skipped', eventLabel: 'Phone Verified Not Skip' }); } window.closeOtpPopup = function () { //document.getElementById('phoneInputOTPModal').style.display = 'none'; if($("#comment").val()){ $('#submit').trigger("click"); } var cookieval = $.cookie("cp_user_email"); if ($("#star_value").val() > 0 && cookieval) { var valu_s = $("#star_value").val(); console.log(".st"+ valu_s,'dgshfjkhfdskjlhglk'); $('#open-modal').css('visibility','visible').css('opacity',1); for(var i=0;i<=valu_s;i++){ $("#popup-star"+valu_s).attr("checked", 'checked'); var selete = $("#rating_change").val(); $(".rating-text").text( selete ); changecheckbox(valu_s); } } document.getElementById('skipOTPNumber').style.display = 'block'; } window.backPhonenumberPopup = function () { document.getElementById('enterPhoneNumber').style.display = 'none'; document.getElementById('loginModal').style.display = 'block'; } window.onlyNumberKey = function (evt) { // Only ASCII charactar in that range allowed /*var ASCIICode = (evt.which) ? evt.which : evt.keyCode if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57)) return false; return true;*/ evt = (evt) ? evt : window.event; var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } return true; } var downloadTimer;

function OTPTimer(){ downloadTimer = setInterval(Timer, 1000); var timeleft = 60; function Timer(){ if(timeleft <= 0){ clearInterval(downloadTimer); document.getElementById("resend-otp").innerHTML = "OTP"; document.getElementById('timerCount').style.pointerEvents="auto"; } else { document.getElementById("resend-otp").innerHTML = "in "+timeleft+"s"; document.getElementById('timerCount').style.pointerEvents="none"; } timeleft -= 1; } } window.submitPhoneNumber = function () { document.getElementById('submitButtonTextOtp').style.display = 'none'; document.getElementById('otpButtonLoader').style.display = 'block'; document.getElementById('invalidPhoneNumber').innerText=""; if (document.getElementById('userPhonenumberForOtp').value.length === 10) { document.getElementById('submitButtonTextOtp').style.display = 'none'; document.getElementById('otpButtonLoader').style.display = 'block'; document.getElementById('currentPhoneNumber').innerText = document.getElementById('userPhonenumberForOtp').value; document.getElementById('getNumber').value = document.getElementById('userPhonenumberForOtp').value; const numberForOTP = document.getElementById('userPhonenumberForOtp').value; const verifyPhoneUrl = USER_API_URL+'phone-verify?src=web'; var data = JSON.stringify({ "phone": numberForOTP }); var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function() { if(this.readyState === 4) { //console.log(this.responseText); var jsonresponse = JSON.parse(this.responseText); //console.log(jsonresponse.data.uuid); document.getElementById('phoneNumberuuid').value = jsonresponse.data.uuid; } }); xhr.open("POST", verifyPhoneUrl); xhr.setRequestHeader("X-Auth-Token", "fpoa43edty5"); xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(data); document.getElementById('enterPhoneNumber').style.display = 'none'; document.getElementById('phoneInputOTPModal').style.display = 'block'; document.getElementById("userPhonenumberForOtp").value=""; OTPTimer(); return; } document.getElementById('invalidPhoneNumber').innerText="Please enter a valid number"; } window.resendPhoneNumber = function ($) { document.getElementById('submitButtonTextOtp').style.display = 'none'; document.getElementById('otpButtonLoader').style.display = 'block'; document.getElementById('invalidPhoneNumber').innerText=""; if (document.getElementById('getNumber').value) { OTPTimer(); document.getElementById('submitButtonTextOtp').style.display = 'none'; document.getElementById('otpButtonLoader').style.display = 'block'; document.getElementById('currentPhoneNumber').innerText = document.getElementById('getNumber').value; const numberForOTP = document.getElementById('getNumber').value; const verifyPhoneUrl = USER_API_URL+'phone-verify?src=web'; var data = JSON.stringify({ "phone": numberForOTP }); var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function() { if(this.readyState === 4) { //console.log(this.responseText); var jsonresponse = JSON.parse(this.responseText); //console.log(jsonresponse.data.uuid); document.getElementById('phoneNumberuuid').value = jsonresponse.data.uuid; } }); xhr.open("POST", verifyPhoneUrl); xhr.setRequestHeader("X-Auth-Token", "fpoa43edty5"); xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(data); document.getElementById('enterPhoneNumber').style.display = 'none'; document.getElementById('phoneInputOTPModal').style.display = 'block'; document.getElementById("userPhonenumberForOtp").value=""; return; } document.getElementById('invalidPhoneNumber').innerText="Please enter a valid number"; } /*phone Number otp done*/ window.backOtpPopup = function () { clearInterval(downloadTimer); document.getElementById("resend-otp").innerHTML = 'OTP'; document.getElementById('enterPhoneNumber').style.display = 'block'; document.getElementById('phoneInputOTPModal').style.display = 'none'; } /*Phone Number Verify Code Start*/ window.editNumber = function(){ clearInterval(downloadTimer); document.getElementById("resend-otp").innerHTML = 'OTP'; document.getElementById("digit-1").value=""; document.getElementById("digit-2").value=""; document.getElementById("digit-3").value=""; document.getElementById("digit-4").value=""; document.getElementById("digit-5").value=""; document.getElementById("digit-6").value=""; document.getElementById('error-message-otp').innerText=""; document.getElementById('phoneInputOTPModal').style.display = 'none'; document.getElementById('enterPhoneNumber').style.display = 'block'; } window.verifyPhoneOTP = function () { // check here var values = []; var fields = document.getElementsByName("myOtp[]"); for(var i = 0; i < fields.length; i++) { var str= fields[i].value; values.push(fields[i].value); } var x = document.getElementById("phontotpInput"); var stringWithCommas = values.join(); var stringWithoutCommas = stringWithCommas.replace(/,/g, ''); document.getElementById('login-error-message-otp').style.display = 'none'; document.getElementById('phontotpInput').value = stringWithoutCommas; const otpValue = document.getElementById('phontotpInput').value; //console.log('otp'+otpValue); const numberForOTP = document.getElementById('getNumber').value; //console.log('number'+numberForOTP); const phoneuuid = document.getElementById('phoneNumberuuid').value; //console.log('uuid'+phoneuuid); document.getElementById('currentPasswordLength').innerHTML = otpValue.length; if (otpValue.length === 6) { //console.log('otp inif'); var data = JSON.stringify({ "phone": numberForOTP, "uuid": phoneuuid, "otp": otpValue }); var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function() { if(this.readyState === 4) { //console.log(this.responseText); var jsonresponse = JSON.parse(this.responseText); //console.log(jsonresponse.success); if(jsonresponse.success === true){ document.getElementById("digit-1").value=""; document.getElementById("digit-2").value=""; document.getElementById("digit-3").value=""; document.getElementById("digit-4").value=""; document.getElementById("digit-5").value=""; document.getElementById("digit-6").value=""; document.getElementById('error-message-otp').innerText=""; document.getElementById('phoneInputOTPModal').style.display = 'none'; if($("#comment").val()){ $('#submit').trigger("click"); } var cookieval = $.cookie("cp_user_email"); if ($("#star_value").val() > 0 && cookieval) { var valu_s = $("#star_value").val(); console.log(".st"+ valu_s,'dgshfjkhfdskjlhglk'); $('#open-modal').css('visibility','visible').css('opacity',1); for(var i=0;i<=valu_s;i++){ $("#popup-star"+valu_s).attr("checked", 'checked'); var selete = $("#rating_change").val(); $(".rating-text").text( selete ); changecheckbox(valu_s); } } ga('send', 'event', { eventCategory: 'Phone number verified', eventAction: 'Verified', eventLabel: 'Phone number verified' }); } else{ document.getElementById("digit-1").value=""; document.getElementById("digit-2").value=""; document.getElementById("digit-3").value=""; document.getElementById("digit-4").value=""; document.getElementById("digit-5").value=""; document.getElementById("digit-6").value=""; document.getElementById('error-message-otp').innerText = jsonresponse.response; } } }); const userJwtToken = document.getElementById('userJwtToken').value; //console.log('userJwtToken'+userJwtToken); xhr.open("POST", USER_API_URL+"addPhone?src=web"); xhr.setRequestHeader("X-JWT-Token", userJwtToken); xhr.setRequestHeader("X-Auth-Token", "fpoa43edty5"); xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(data); //console.log('data'+data); //postDataToServer(); /*const otpInputNode = document.getElementById('otpInput'); otpInputNode.setAttribute('disabled', true); otpInputNode.classList.add("custom-disabled"); const data = { phone: document.getElementById('userPhonenumberForOtp').value, otp: otpValue }; postDataToServer(USER_API_URL+'verifyOTP', data)*/ } else{ //console.log('otp inelse'); } } /*Phone Number Verify Code End*/ window.getDataFromServer = function (theUrl, callback) { var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState === 4 && xmlHttp.status === 200) { // show otp input field document.getElementById('inputOTPModal').style.display = 'block'; document.getElementById('currentUserEmailId').innerText = document.getElementById('userEmailForOtp').value document.getElementById('sendOtpForPasswordReset').style.display = 'none'; } else if (xmlHttp.readyState === 4 && xmlHttp.status === 401) { const resp = JSON.parse(xmlHttp.response); if (resp.path === '/forgotPassword') { document.getElementById('otpButtonLoader').style.display = 'none'; document.getElementById('submitButtonTextOtp').style.display = 'block'; } document.getElementById('invalidEmailForResetPassword').innerText = resp.message; } // callback(xmlHttp.responseText); hideLoader(); }; xmlHttp.open("GET", theUrl); // true for asynchronous xmlHttp.setRequestHeader("Content-Type", "application/json"); xmlHttp.setRequestHeader("X-Auth-Token", "fpoa43edty5"); xmlHttp.send(null); hideLoader(); } window.postDataToServer = function (url, data) { const http = new XMLHttpRequest(); let cpOrigin = (mobileCheck()?cpOriginMWeb[window.location.host]:cpOriginWeb[window.location.host]) || 11; http.open('POST', url, true); //Send the proper header information along with the request http.setRequestHeader("Content-Type", "application/json"); http.setRequestHeader("X-Auth-Token", "fpoa43edty5"); http.setRequestHeader("cp-origin", cpOrigin); // http.setRequestHeader("cp-origin", _isMobileDevice()?'70':'80'); http.onreadystatechange = function () { //Call a function when the state changes. if (http.readyState === 4 && http.status === 200) { hideLoader(); if (http.responseURL === USER_API_URL+'verifyOTP') { document.getElementById('showPasswordResetModal').style.display = 'block'; document.getElementById('sendOtpForPasswordReset').style.display = 'none'; document.getElementById('otpInput').classList.remove("custom-disabled"); document.getElementById('otpInput').removeAttribute('disabled'); } if (http.response) { const response = JSON.parse(http.response); if (http.responseURL === USER_API_URL+'login' || http.responseURL === USER_API_URL+'register') { console.log('i should not be there', http.responseURL); document.getElementById('loginModal').style.display = 'none'; document.getElementById('signUpModal').style.display = 'none'; var phoneVerified = response.userInfo.phoneVerified; var jwtToken = response.jwtToken; // console.log('jwtToken'+jwtToken); document.getElementById('userJwtToken').value = jwtToken; //console.log('inif'); if($.trim(phoneVerified) === "false"){ //console.log('iniffun'); document.getElementById('enterPhoneNumber').style.display = 'block'; setUserDetailsInCookie(response); } else{ setUserDetailsInCookie(response); } if ($.trim(phoneVerified) == "true") { console.log(phoneVerified,'dasd'); if($("#comment").val()){ $('#submit').trigger("click"); } var cookieval = $.cookie("cp_user_email"); console.log(cookieval,'cookieval'); // alert('tyess'); if ($("#star_value").val() > 0 ) { var valu_s = $("#star_value").val(); console.log(".st"+ valu_s,'dgshfjkhfdskjlhglk'); $('#open-modal').css('visibility','visible').css('opacity',1); for(var i=0;i<=valu_s;i++){ $("#popup-star"+valu_s).attr("checked", 'checked'); var selete = $("#rating_change").val(); $(".rating-text").text( selete ); changecheckbox(valu_s); } } if($("#comment").val()){ $('#submit').trigger("click"); } } } } } if (http.readyState === 4 && (http.status === 400 || http.status === 401)) { const response = JSON.parse(http.response); if (JSON.parse(http.response).path === '/verifyOTP') { document.getElementById('otpInput').classList.remove("custom-disabled"); document.getElementById('login-error-message-otp').style.display = 'block'; document.getElementById('login-error-message-otp').innerText = response.message; document.getElementById('otpInput').removeAttribute('disabled') } document.getElementById('login-error-message').innerText = response.message; if (JSON.parse(http.response).path === '/register') { document.getElementById('signup-error-message').innerText = response.message; document.getElementById('submitSignUpButtonText').style.display = 'block'; document.getElementById('signUpButtonLoader').style.display = 'none'; } } hideLoader(); }; http.send(JSON.stringify(data)); } window.getCartFromServer = function (token) { if (getCookie('OFFLINE_CART_ITEMS') !== undefined && getCookie('OFFLINE_CART_ITEMS') !== '0') { // send POST call to server to update cart jQuery.ajax({ url: STORE_URL+"cart?forcefully=true", type: "POST", data: getCookie('OFFLINE_CART_ITEMS'), beforeSend: function (xhr) { xhr.setRequestHeader("X-Auth-Token", "fpoa43edty5"); xhr.setRequestHeader("X-JWT-Token", token); xhr.setRequestHeader("Content-Type", "application/json"); }, success: function (data) { const cartLength = data.data.carts.filter(e => e.purchasable) .length; // setCookie('cp_cart_count', cartLength, 7); document.getElementById('cartCount').innerHTML = cartLength; window.updateCartCountInCookie(cartLength)

} });

} else { jQuery.ajax({ url: STORE_URL+"cart", type: "GET", beforeSend: function (xhr) { xhr.setRequestHeader("X-Auth-Token", "fpoa43edty5"); xhr.setRequestHeader("X-JWT-Token", token); xhr.setRequestHeader("Content-Type", "application/json");

}, success: function (data) { const cartLength = data.data.carts.filter(e => e.purchasable) .length; // setCookie('cp_cart_count', cartLength, 7); document.getElementById('cartCount').innerHTML = cartLength; window.updateCartCountInCookie(cartLength) } }); }

} if(typeof String.prototype.trim !== 'function') { String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); } } window.setUserDetailsInCookie = function (response) {

const email = response.userInfo.email; const token = response.jwtToken; const name = response.userInfo.name; var user = response.userInfo.wasUserExists; if(response.userInfo.wasUserExists){ if($.trim(user) == "true"){ document.cookie = "cp_user_type=Old"; $("#adda247_lead_form_userType").val('Old'); } if($.trim(user) == "false"){ document.cookie = "cp_user_type=New"; $("#adda247_lead_form_userType").val('New'); } }

//const name="profile";

window.updateUserDataInCookie(email, token, name); setCookie('cp_token', token, 7); //console.log(name); var first = decodeURI(name); first = first.split(" ")[0];

document.getElementById('userNameTopNav').innerHTML = first; document.getElementById('static-name').innerHTML = first; document.getElementsByTagName('body')[0].classList.remove('no-overflow'); document.getElementById('loginModal').style.display = 'none'; document.getElementById('signUpModal').style.display = 'none'; document.getElementById('showPasswordResetModal').style.display = 'none'; document.getElementById('inputOTPModal').style.display = 'none'; document.getElementById('sendOtpForPasswordReset').style.display = 'none'; document.getElementById('login-topnav').style.display = 'none'; const userDetailDiv = document.getElementById('userDetailsDiv'); document.getElementById('userNameTopNav').setAttribute('title', first); document.getElementById('userNameTopNav').innerHTML = first userDetailDiv.style.display = 'block'; document.getElementById('static-name').setAttribute('title', first); document.getElementById('static-name').innerHTML = first userDetailDiv.style.display = 'block'; hideUserProfileMenu() // getCartFromServer(token);

}

window.showUserProfileMenu = function () { // show menu and toggle chevron icon document.getElementById('userMenuDropdownItems').style.display = 'block';

}

window.hideUserProfileMenu = function () { document.getElementById('userMenuDropdownItems').style.display = 'none'; }

window.logoutUser = function () { document.cookie.split('').forEach(function (c) { document.cookie = c.replace(/^ +/, '').replace(/=.*/, '=;expires=" + new Date().toUTCString() + ";path=/;'); });

document.getElementById('userDetailsDiv').style.display = 'none'; document.getElementById('login-topnav').style.display = 'block'; document.getElementById('login-topnav').style.visibility = 'visible'; // setCookie('cp_cart_count', 0, -1); document.cookie = "cp_user_type="; window.removeUserDataInCookie(); //delete_cookie('cp_user_type');

/* document.getElementById('cartCount').innerHTML = '0'; document.getElementById('cartCount').innerHTML = '0'; */ }

window.setCookie = function (name, value, days) { let expires = ""; if (days) { let date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/;"; }

window.eraseCookie = function (name) { document.cookie = name + '=; Max-Age=-99999999;'; }

function checkForCookie() {

if (!getCookie('cp_token') || getCookie('cp_token').length < 3 || !getCookie('cp_user_name')) { return false; } return true; } function cookieStatus() { if (checkForCookie()) { var userFirstName = getCookie('cp_user_name'); var firstName = decodeURI(userFirstName); firstName = firstName.split(" ")[0]; // hide the login button on top nav //alert("true"); document.getElementById('login-topnav').style.display = 'none'; document.getElementById('userDetailsDiv').style.display = 'block'; // jQuery('#login-topnav').hide(); // JQuery('#userDetailsDiv').show(); document.getElementById('userNameTopNav').innerText = firstName; document.getElementById('static-name').innerText = firstName; //document.getElementById('userNameTopNav').innerText="Profile"; document.getElementById('userNameTopNav').setAttribute('title', firstName); document.getElementById('static-name').setAttribute('title', firstName); //getCartFromServer(getCookie('cp_token')); //document.getElementById('cartCount').innerHTML = getCookie('cp_cart_count'); } else { document.getElementById('login-topnav').style.visibility = 'visible'; if (getCookie('OFFLINE_CART_ITEMS')) { var cartLength = JSON.parse(getCookie('OFFLINE_CART_ITEMS')).length || 0; // document.getElementById('cartCount').innerText = cartLength; } } } setTimeout(cookieStatus, 4000); function showLoginModalWithValuesReset() { // document.getElementById('loginModal').style.display = "block"; // document.getElementsByTagName('body')[0].classList.add('no-overflow'); // document.getElementById('loginModal').style.display='block'; // if(loginModalDisplay == 'none') // { // loginModalDisplay = 'block'; // } var loginModal = document.getElementById('loginModal'); var loginModalDisplay = loginModal.style.display; // loginModal.classList.toggle("show"); //alert('Hello there'); // document.getElementById('loginEmail').value=""; // document.getElementById('loginPassword').value=""; // document.getElementById('loginEmailError').innerText=""; // document.getElementById('loginPasswordError').innerText=""; // document.getElementById('login-error-message').innerText=""; // document.getElementById('newPassword').value=""; // document.getElementById('reEnterPassword').value=""; // document.getElementById('showPasswordResetModal').style.display = 'none'; // document.getElementById('inputOTPModal').style.display = 'none'; // document.getElementById('userEmailForOtp').value=""; // document.getElementById('otpButtonLoader').style.display = 'none'; // document.getElementById('otpInput').value=""; // document.getElementById('submitButtonTextOtp').style.display='block'; // resetSignUpForm(); // clearSignUpFormErrors(); } // showLoginModalWithValuesReset function showSignUpmodal() { document.getElementById('loginModal').sty le.display = 'none'; document.getElementById('signUpModal').style.display = 'block'; } function closeLoginModal() { document.getElementById('loginEmailError').style.display = 'none'; document.getElementsByTagName('body')[0].classList.remove('no-overflow'); document.getElementById('loginModal').style.display = 'none'; } function checkLoginState() { FB.getLoginStatus(function (response) { statusChangeCallback(response); }); } // This function is called when someone finishes with the Login // Button. See the onlogin handler attached to it in the sample // code below. function checkLoginState() { FB.getLoginStatus(function (response) { statusChangeCallback(response); }); } window.fbAsyncInit = function () { FB.init({ appId: '233923120281900', cookie: true, // enable cookies to allow the server to access // the session xfbml: true, // parse social plugins on this page version: 'v3.2' // The Graph API version to use for the call }); // Now that we've initialized the JavaScript SDK, we call // FB.getLoginStatus(). This function gets the state of the // person visiting this page and can return one of three states to // the callback you provide. They can be: // // 1. Logged into your app ('connected') // 2. Logged into Facebook, but not your app ('not_authorized') // 3. Not logged into Facebook and can't tell if they are logged into // your app or not. // // These three cases are handled in the callback function. // }; // Load the SDK asynchronously (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); // Here we run a very simple test of the Graph API after login is // successful. See statusChangeCallback() for when this call is made. function testAPI(data) { FB.api('/me', 'get', { access_token: data.accessToken, fields: 'id,name,gender,email' }, function (response) { }); FB.api('/me?fields=name,email', function (response) { // call adda247- api const userDetails = { email: response.email, name: response.name, providerName: "f", providerToken: data.accessToken, providerUserId: data.userID, }; registerOrLoginUser(userDetails); setTimeout(function(){ var lableType; var loginUserType = getCookie('cp_user_type'); if($.trim(loginUserType) === "Old"){ lableType="Signin"; } else{ lableType="signUpModalp"; } ga('send', 'event', { eventCategory: 'Login Method', eventAction: 'Facebook', eventLabel: lableType }); }, 2000); }); } /*OTP*/ // This is called with the results from from FB.getLoginStatus(). /* function statusChangeCallback(response) { // The response object is returned with a status field that lets the // app know the current login status of the person. // Full docs on the response object can be found in the documentation // for FB.getLoginStatus(). if (response && response.status === 'connected') { // Logged into your app and Facebook. testAPI(response.authResponse); } else { FB.login(); } } */ /* if(window.screen.width<=768){ var newParent = document.querySelector('.header-search-wrap'); newParent.appendChild(document.querySelector(".login-widget-container")); } window._isMobileDevice = function() { let check = false; (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); return check; };*/ /*jQuery(document).read(function($){ $('#phoneInputOTPModal #enterOTPForm').find('input').each(function() { $(this).attr('maxlength', 1); $(this).on('keyup', function(e) { var parent = $($(this).parent()); if(e.keyCode === 8 || e.keyCode === 37) { var prev = parent.find('input.' + $(this).data('previous')); if(prev.length) { $(prev).select(); } } else if((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode === 39) { var next = parent.find('input.' + $(this).data('next')); if(next.length) { $(next).select(); } else { if(parent.data('autosubmit')) { parent.submit(); } } } }); }); });*/ jQuery(document).ready(function($){ /* $('.phoneOtpClass').find('input').each(function() { $(this).attr('maxlength', 1); $(this).on('keyup', function(e) { var parent = $($(this).parent()); if(e.keyCode === 8 || e.keyCode === 37) { var prev = parent.find('input#' + $(this).data('previous')); if(prev.length) { $(prev).select(); } } else if((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode === 39) { var next = parent.find('input#' + $(this).data('next')); if(next.length) { $(next).select(); } else { if(parent.data('autosubmit')) { parent.submit(); } } } }); }); */ var charLimit = 1; $(".inputs").keydown(function(e) { var keys = [8, 9, /*16, 17, 18,*/ 19, 20, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 144, 145]; if (e.which == 8 && this.value.length == 0) { $(this).prev('.inputs').focus(); } else if ($.inArray(e.which, keys) >= 0) { return true; } else if (this.value.length >= charLimit) { $(this).next('.inputs').focus(); return false; } else if (e.shiftKey || e.which < 48 || e.which > 58) { return false; } }).keyup (function () { if (this.value.length >= charLimit) { $(this).next('.inputs').focus(); return false; } });

}); })(jQuery);

function changecheckbox(valdue){ $("#star_count").val(valdue); // console.log(valdue); if (valdue > 3) { $('.first3star').prop('checked',false).hide(); $('.last2star').prop('checked',false).show(); }else{ $('.last2star').prop('checked',false).hide(); $('.first3star').prop('checked',false).show(); } }



Source link