(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e51e4"],{"92b7":function(e,a,t){"use strict";t.r(a);var n=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{staticClass:"vue-template forbgl"},[t("div",{staticClass:"container "},[t("div",{staticClass:"row mt-5 mb-5"},[t("div",{staticClass:"col-md-8 offset-md-2 vertical-center loginw"},[t("h3",{staticClass:"text-center mb-4"},[e._v("Checkout Payment")]),e.upgradeMode?t("div",{staticClass:"my-3"},[e._v("Plan Upgrade")]):t("div",{staticClass:"my-3"},[e._v("New Plan Purchase")]),t("hr"),t("form",{},[t("div",{staticClass:"row"},[t("div",{staticClass:"form-group col-md-6"},[t("label",[e._v("Name")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.isLogged.name,expression:"isLogged.name"}],staticClass:"form-control",attrs:{type:"text",id:"name",readonly:""},domProps:{value:e.isLogged.name},on:{input:function(a){a.target.composing||e.$set(e.isLogged,"name",a.target.value)}}}),t("div",{staticClass:"status",attrs:{id:"name-status"}})]),t("div",{staticClass:"form-group col-md-6"},[t("label",[e._v("Email")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.isLogged.email,expression:"isLogged.email"}],staticClass:"form-control",attrs:{type:"text",id:"email",readonly:""},domProps:{value:e.isLogged.email},on:{input:function(a){a.target.composing||e.$set(e.isLogged,"email",a.target.value)}}}),t("div",{staticClass:"status",attrs:{id:"email-status"}})]),t("div",{staticClass:"form-group col-md-6"},[t("label",[e._v("Mobile Number")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.isLogged.mobile,expression:"isLogged.mobile"}],staticClass:"form-control",attrs:{id:"number",type:"text",readonly:""},domProps:{value:e.isLogged.mobile},on:{input:function(a){a.target.composing||e.$set(e.isLogged,"mobile",a.target.value)}}}),t("div",{staticClass:"status",attrs:{id:"number-status"}})]),[t("div",{staticClass:"text-center w-100 my-2"},[e._v(" Plan Details to Upgrade "),t("hr"),e._v(" Billing Annually. "),t("br"),t("small",[e._v("Monthly Rate: ₹"+e._s(Math.floor(e.price/12)))])]),t("div",{staticClass:"form-group col-md-6",attrs:{"ð":""}},[t("label",[e._v("Name")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.plan.plans_name,expression:"plan.plans_name"}],staticClass:"form-control",attrs:{type:"text",id:"plans_name",disabled:""},domProps:{value:e.plan.plans_name},on:{input:function(a){a.target.composing||e.$set(e.plan,"plans_name",a.target.value)}}})]),t("div",{staticClass:"form-group col-md-6"},[t("label",[e._v("Price (Rs)")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.price,expression:"price"}],staticClass:"form-control",attrs:{id:"price",type:"number",disabled:""},domProps:{value:e.price},on:{input:function(a){a.target.composing||(e.price=a.target.value)}}})])]],2),t("div",{staticClass:"text-center mt-3"},[t("button",{staticClass:"primary-button",on:{click:e.makePayment}},[e._v(" Proceed To Pay ")])])])])])])])},r=[],s=(t("b0c0"),t("5530")),i=(t("96cf"),t("1da1")),o=t("97af"),l=t("525b"),c=t("2f62"),m={name:"payment",components:{},data:function(){return{id:this.$route.params.id,plan:"",name:"",email:"",plans_name:"",price:"",order_id:"",mobile:"",isLogged:"",upgradeMode:!1,action:"/planregister"}},mounted:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function a(){var t,n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return Object(l["a"])(),a.next=3,o["a"].get("/planview/"+e.id);case 3:if(t=a.sent,e.plan=t.data,e.price=e.plan.price,console.log(e.plan,e.currentPlan),!e.currentPlan){a.next=15;break}if(e.allowUpgrade(e.plan)){a.next=11;break}return console.log("no upgrade allowed"),a.abrupt("return",e.$router.push({name:"pricing"}));case 11:e.price=e.getUpgradePrice(e.plan),e.upgradeMode=!0,a.next=17;break;case 15:if(e.plan){a.next=17;break}return a.abrupt("return",e.$router.push({name:"pricing"}));case 17:n=e.user,n&&(e.isLogged=n);case 19:case"end":return a.stop()}}),a)})))()},computed:Object(s["a"])(Object(s["a"])(Object(s["a"])({},Object(c["d"])("auth",{user:"user",authenticated:"authenticated"})),Object(c["d"])("plan",{currentPlan:"currentPlan"})),Object(c["c"])("plan",{getUpgradePrice:"getUpgradePrice",allowUpgrade:"allowUpgrade"})),methods:Object(s["a"])(Object(s["a"])({},Object(c["b"])("auth",{fetchUser:"fetchUser",logoutUser:"logout"})),{},{makePayment:function(e){e.preventDefault(),this.name=$("#name").val(),this.email=$("#email").val(),this.mobile=$("#number").val(),this.plans_name=$("#plans_name").val(),this.price=$("#price").val();var a={};a["name"]=this.name,a["email"]=this.email,a["number"]=this.mobile,a["amount"]=this.price,a["plans_name"]=this.plans_name,a["plan_id"]=this.plan.id;var t=this;o["a"].post(this.action,a).then(function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(n){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=new Razorpay({key:"rzp_live_oxDeoBrHaTBpbC",amount:100*a.amount,name:a.name,currency:"INR",description:a.plans_name,handler:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.handleRazorpayPayment(n,a);case 2:case"end":return e.stop()}}),e)})));function r(){return e.apply(this,arguments)}return r}(),prefill:{name:a.name,email:a.email,contact:a.mobile},notes:{address:""},theme:{color:"#CE4536"}}),r.open();case 2:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}()).catch((function(e){console.log("ERR",e)}))},validateEmail:function(){var e,a=/^([_a-zA-Z0-9-]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/,t=a.test(this.email);return e=!1===t?"Email is not valid yet.":"Done!",document.getElementById("email-status").innerHTML=e,t},validatenumber:function(){for(var e,a=!0,t=0,n=0;n="0"&&this.number[n]<="9"?t++:a=!1;return e=0==a?"Oops!!! Digits only.":10!=t?"No!!! Just 10 digits":"Done!",document.getElementById("number-status").innerHTML=e,a&&10==t},handleRazorpayPayment:function(e,a){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function n(){var r,s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:r="/plans/purchase",t.upgradeMode&&(r="/plans/upgrade"),s={razorpay_payment_id:e.razorpay_payment_id,plans_name:a.plans_name,plan_id:a.plan_id},o["a"].post(r,s).then((function(e){t.$toasted.success("Payment success!",{keepOnHover:!0,iconPack:"fontawesome",icon:"check",theme:"toasted-primary",duration:3e3}),location.href="/dashboard"})).catch((function(e){console.log(e.message)}));case 4:case"end":return n.stop()}}),n)})))()}})},u=m,p=t("2877"),d=Object(p["a"])(u,n,r,!1,null,null,null);a["default"]=d.exports}}]);
//# sourceMappingURL=chunk-2d0e51e4.4333c0b1.js.map