"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6668],{50042:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var r=a(20629),n=a(74865),s=a.n(n);function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?i(Object(a),!0).forEach((function(t){c(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function c(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const l={metaInfo:{title:"Payment Gateway"},data:function(){return{isLoading:!0,gateway:{stripe_key:"",stripe_secret:"",deleted:!1}}},methods:o(o({},(0,r.nv)(["refreshUserPermissions"])),{},{Submit_Payment:function(){var e=this;this.$refs.form_payment.validate().then((function(t){t?e.Update_Payment():e.makeToast("danger",e.$t("Please_fill_the_form_correctly"),e.$t("Failed"))}))},makeToast:function(e,t,a){this.$root.$bvToast.toast(t,{title:a,variant:e,solid:!0})},getValidationState:function(e){var t=e.dirty,a=e.validated,r=e.valid;return t||a?void 0===r?null:r:null},Update_Payment:function(){var e=this;s().start(),s().set(.1),axios.post("payment_gateway",{stripe_key:this.gateway.stripe_key,stripe_secret:this.gateway.stripe_secret,deleted:this.gateway.deleted}).then((function(t){Fire.$emit("Event_payment"),e.makeToast("success",e.$t("Successfully_Updated"),e.$t("Success")),s().done()})).catch((function(t){s().done(),e.makeToast("danger",e.$t("InvalidData"),e.$t("Failed"))}))},Get_Payment_Gateway:function(){var e=this;axios.get("get_payment_gateway").then((function(t){e.gateway=t.data.gateway,e.isLoading=!1})).catch((function(t){e.isLoading=!1}))}}),created:function(){var e=this;this.Get_Payment_Gateway(),Fire.$on("Event_payment",(function(){e.Get_Payment_Gateway()}))}};const d=(0,a(51900).Z)(l,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"main-content"},[a("breadcumb",{attrs:{page:e.$t("payment_gateway"),folder:e.$t("Settings")}}),e._v(" "),e.isLoading?a("div",{staticClass:"loading_page spinner spinner-primary mr-3"}):e._e(),e._v(" "),e.isLoading?e._e():a("validation-observer",{ref:"form_payment"},[a("b-form",{on:{submit:function(t){return t.preventDefault(),e.Submit_Payment.apply(null,arguments)}}},[a("b-row",{staticClass:"mt-5"},[a("b-col",{attrs:{lg:"12",md:"12",sm:"12"}},[a("b-card",{attrs:{"no-body":"",header:e.$t("Payment_Gateway")}},[a("b-card-body",[a("b-row",[a("b-col",{attrs:{lg:"6",md:"6",sm:"12"}},[a("b-form-group",{attrs:{label:"STRIPE_KEY"}},[a("b-form-input",{attrs:{type:"password",placeholder:e.$t("LeaveBlank")},model:{value:e.gateway.stripe_key,callback:function(t){e.$set(e.gateway,"stripe_key",t)},expression:"gateway.stripe_key"}})],1)],1),e._v(" "),a("b-col",{attrs:{lg:"6",md:"6",sm:"12"}},[a("b-form-group",{attrs:{label:"STRIPE_SECRET"}},[a("b-form-input",{attrs:{type:"password",placeholder:e.$t("LeaveBlank")},model:{value:e.gateway.stripe_secret,callback:function(t){e.$set(e.gateway,"stripe_secret",t)},expression:"gateway.stripe_secret"}})],1)],1),e._v(" "),a("b-col",{staticClass:"mt-3 mb-3",attrs:{md:"6"}},[a("label",{staticClass:"switch switch-primary mr-3"},[e._v("\n                       "+e._s(e.$t("Remove_Stripe_Key_Secret"))+"\n                        "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.gateway.deleted,expression:"gateway.deleted"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.gateway.deleted)?e._i(e.gateway.deleted,null)>-1:e.gateway.deleted},on:{change:function(t){var a=e.gateway.deleted,r=t.target,n=!!r.checked;if(Array.isArray(a)){var s=e._i(a,null);r.checked?s<0&&e.$set(e.gateway,"deleted",a.concat([null])):s>-1&&e.$set(e.gateway,"deleted",a.slice(0,s).concat(a.slice(s+1)))}else e.$set(e.gateway,"deleted",n)}}}),e._v(" "),a("span",{staticClass:"slider"})])]),e._v(" "),a("b-col",{attrs:{md:"12"}},[a("b-form-group",[a("b-button",{attrs:{variant:"primary",type:"submit"}},[e._v(e._s(e.$t("submit")))])],1)],1)],1)],1)],1)],1)],1)],1)],1)],1)}),[],!1,null,null,null).exports}}]);