‘;
if(neverShowNotificaitonCookie == ” || neverShowNotificaitonCookie == ‘undefined’ || neverShowNotificaitonCookie == null){
var lastReminderCookie = getCookie(‘_ler’+loginParamObj.uId);//last expiry reminder
if( (lastReminderCookie == “”) || (lastReminderCookie == “undefined”) || (lastReminderCookie == null) ){
$(‘body’).prepend(notificationBox);
}else{
if(lastReminderCookie ‘);
$(“#loading_invoice”).show();
var _id = this.id;

$.ajax({
“type”: “POST”,
“url”: “http://api.business-standard.com/user/process-api/generate-user-invoice”,
“data” : {
“request_id” : loginParamObj.uId
},
“success”: function(data){
$(“#generate_invoice”).text(‘click here’);
resopnseObject = JSON.parse(data);

if(resopnseObject.status == ‘success’){
if(resopnseObject.tinyUrl != “” || resopnseObject.tinyUrl != null){
$(“#notification_message”).html(‘Your invoice has been sucessfully generated.
Please click here to pay ‘);
window.open(resopnseObject.tinyUrl,”_blank”);

if($(“#generate_invoice_manage”).length > 0){
location.reload();
}
generateInvoice2 = function(){};
}else{
alert(“Your invoice has been successfully generated. Please check your mail.”);
generateInvoice2 = function(){alert(“Your invoice has been successfully generated. Please check your mail.”);};
}

}else{
alert(“Your request has been registered by us. We will contact you soon”);
generateInvoice2 = function(){alert(“Your request has been registered by us. We will contact you soon”);};
remindNotificationLater(loginParamObj.uId);
}
$(“#loading_invoice”).hide();
}
});
return false;

}

}
}
}
}
});

function remindNotificationLater(userId){
var currentTimestamp = Math.floor(Date.now() / 1000);
var tempTime = new Date(currentTimestamp*1000);
var lastExpNotification = Math.floor(tempTime.setMinutes(tempTime.getMinutes() + 60) / 1000);//+60 mins
//Set Cookie
var d = new Date();
d.setTime(d.getTime() + (60*60*1000));//60 min
var expires = “expires=”+d.toUTCString();
document.cookie = “_ler”+userId+”=” + lastExpNotification + “; ” + expires + “; path=/”;
$(‘#endSubscriptionNotification’).remove();
}

function closeNotificationForever(userId){
var neverShowNotificaitonCookie = getCookie(‘_nsn’);
neverShowNotificaitonCookie += “,”+userId;
//Set Cookie
var d = new Date();
d.setTime(d.getTime() + (30*24*60*60*1000));//30 days
var expires = “expires=”+d.toUTCString();
document.cookie = “_nsn=” + neverShowNotificaitonCookie + “; ” + expires + “; path=/”;

$(‘#endSubscriptionNotification’).remove();
}



Source link

Comments

comments