function addClientClickToButton(){removeClientClickToButton();$("#btnPayNow").on("click",function(){var n=$(this);$("#bform").valid()&&(processing(n),$.ajax({type:"POST",url:"/buynow/CreateOrder",data:JSON.stringify($("#bform").serializeFormJSON()),contentType:"application/json; charset=utf-8",success:function(t){if(t===undefined||t.id===undefined){changePaymentTypeAndSubmitForm(2);return}var i=new Razorpay({key:t.ClientKey,currency:"USD",order_id:t.id,amount:t.Amount,description:t.ReportTitle,name:"Zion Market Research",prefill:{name:$("#Name").val(),email:$("#Email").val(),contact:$("#ContactNumber").val()},handler:function(t){$.ajax({type:"post",url:"/buynow/RazorPaymentSuccess",data:JSON.stringify(t),contentType:"application/json;charset=utf-8",success:function(n){n.Success&&(window.location.href="/process")},error:function(){stopProcessing(n)}})},modal:{ondismiss:function(){stopProcessing(_paymentButton)}}});i.open()},error:function(){stopProcessing(n)}}))})}function processing(n){$("div.overlay").addClass("show");$(n).text("Processing....")}function stopProcessing(){$("div.overlay").removeClass("show")}function jsChangePaymentMethod(){$("#PaymentType").val()==="5"?($("#btnPayNow").attr("type","button"),addClientClickToButton()):($("#btnPayNow").attr("type","submit"),removeClientClickToButton())}function removeClientClickToButton(){$("#btnPayNow").off("click")}function changePaymentTypeAndSubmitForm(n){$("#PaymentType").val(n);$("#bform").submit()}function RazorPayPayment(n){var t=n!=null?$(n):null;$("#bform").valid()&&$.ajax({type:"POST",url:"/buynow/CreateOrder",data:JSON.stringify($("#bform").serializeFormJSON()),contentType:"application/json; charset=utf-8",success:function(n){if(n===undefined||n.id===undefined){changePaymentTypeAndSubmitForm(2);return}var t=new Razorpay({key:n.ClientKey,currency:"USD",order_id:n.id,amount:n.Amount,description:n.ReportTitle,name:"Zion Market Research",prefill:{name:$("#Name").val(),email:$("#Email").val(),contact:$("#ContactNumber").val()},handler:function(n){$.ajax({type:"post",url:"/buynow/RazorPaymentSuccess",data:JSON.stringify(n),contentType:"application/json;charset=utf-8",success:function(n){n.Success&&(window.location.href="/process");alert(n.Message)},error:function(){}})},modal:{ondismiss:function(){stopProcessing(_paymentButton)}}});t.open()},error:function(){stopProcessing(t)}})}(function(n){n.fn.serializeFormJSON=function(){var t={},i=this.serializeArray();return n.each(i,function(){t[this.name]?(t[this.name].push||(t[this.name]=[t[this.name]]),t[this.name].push(this.value||"")):t[this.name]=this.value||""}),t}})(jQuery);var _paymentButton={};$(document).ready(function(){$("body").append('<div class="overlay"><\/div>')})