Files
vuefilemanager/public/chunks/payments/settings.js
Čarodej ceba8f5cc1 fixes
2022-01-13 18:55:10 +01:00

1 line
31 KiB
JavaScript
Vendored

(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{"/nGJ":function(t,e,a){"use strict";a("T0k5")},"6TPS":function(t,e,a){"use strict";var s=a("CjXH"),i={props:["data"],computed:{normalizedColumns:function(){return this.data.id&&delete this.data.id,Object.values(this.data)}}},n=(a("/nGJ"),a("KHd+")),r=Object(n.a)(i,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("tr",{staticClass:"table-row"},t._l(t.normalizedColumns,(function(e,s){return a("td",{key:s,staticClass:"table-cell"},[a("span",[t._v(t._s(e))])])})),0)}),[],!1,null,"d6678dd0",null).exports,o=a("vDqi"),l=a.n(o),p={name:"DatatableWrapper",props:["columns","scope","paginator","api","tableData"],components:{ChevronRightIcon:s.k,ChevronLeftIcon:s.j,DatatableCell:r,ChevronUpIcon:s.l},computed:{hasData:function(){return this.data&&this.data.data&&this.data.data.length>0},floatPages:function(){return[this.pageIndex-1,this.pageIndex,this.pageIndex+1]}},data:function(){return{data:void 0,isLoading:!0,pageIndex:1,filter:{sort:"DESC",field:void 0}}},methods:{goToPage:function(t){t>this.data.meta.last_page||0===t||(this.pageIndex=t,this.getPage(t))},sort:function(t,e){e&&(this.filter.field=t,"DESC"===this.filter.sort?this.filter.sort="ASC":"ASC"===this.filter.sort&&(this.filter.sort="DESC"),this.getPage(this.pageIndex))},getPage:function(t){var e=this;this.URI=this.api,this.paginator&&(this.URI=this.URI+"?page="+t),this.filter.field&&(this.URI=this.URI+(this.paginator?"&":"?")+"sort="+this.filter.field+"&direction="+this.filter.sort),this.isLoading=!0,l.a.get(this.URI).then((function(t){e.data=t.data,e.$emit("data",t.data)})).catch((function(){return e.$isSomethingWrong()})).finally((function(){e.$emit("init",!0),e.isLoading=!1}))}},created:function(){this.api&&this.getPage(this.pageIndex),this.tableData&&(this.data=this.tableData,this.isLoading=!1)}},c=(a("jWOf"),Object(n.a)(p,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"w-full"},[t.hasData?a("table",{staticClass:"w-full"},[a("thead",{},[a("tr",t._l(t.columns,(function(e,s){return e.hidden?t._e():a("th",{key:s,staticClass:"text-left",class:{"sortable cursor-pointer":e.sortable,"text-right":Object.values(t.columns).length-1===s},on:{click:function(a){return t.sort(e.field,e.sortable)}}},[a("span",{staticClass:"dark:text-gray-500 text-gray-400 text-xs"},[t._v("\n\t\t\t\t\t\t\t"+t._s(e.label)+"\n\t\t\t\t\t\t")]),t._v(" "),e.sortable?a("chevron-up-icon",{staticClass:"inline-block vue-feather dark:text-gray-500 text-gray-300",class:{"arrow-down":"ASC"===t.filter.sort},attrs:{size:"12"}}):t._e()],1)})),0)]),t._v(" "),a("tbody",{staticClass:"table-body"},[t._l(t.data.data,(function(e){return t._t("default",(function(){return[a("DatatableCell",{key:e.id,attrs:{data:e}})]}),{row:e})}))],2)]):t._e(),t._v(" "),t.isLoading||t.hasData?t._e():t._t("empty-page"),t._v(" "),t.paginator&&t.hasData?a("div",{staticClass:"paginator-wrapper"},[t.data.meta.total>15&&t.data.meta.last_page<=6?a("ul",{staticClass:"pagination flex align-items"},[a("li",{staticClass:"page-item previous"},[a("a",{staticClass:"page-link",class:{disabled:0==t.pageIndex},on:{click:function(e){return t.goToPage(t.pageIndex-1)}}},[a("chevron-left-icon",{staticClass:"icon",attrs:{size:"14"}})],1)]),t._v(" "),t._l(t.data.meta.last_page,(function(e,s){return a("li",{key:s,staticClass:"page-item",on:{click:function(a){return t.goToPage(e)}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===e}},[t._v("\n "+t._s(e)+"\n ")])])})),t._v(" "),a("li",{staticClass:"page-item next"},[a("a",{staticClass:"page-link",class:{disabled:t.pageIndex+1==t.data.meta.last_page},on:{click:function(e){return t.goToPage(t.pageIndex+1)}}},[a("chevron-right-icon",{staticClass:"icon",attrs:{size:"14"}})],1)])],2):t._e(),t._v(" "),t.data.meta.total>15&&t.data.meta.last_page>6?a("ul",{staticClass:"pagination"},[a("li",{staticClass:"page-item previous"},[a("a",{staticClass:"page-link",class:{disabled:0==t.pageIndex},on:{click:function(e){return t.goToPage(t.pageIndex-1)}}},[a("chevron-left-icon",{staticClass:"icon",attrs:{size:"14"}})],1)]),t._v(" "),t.pageIndex>=5?a("li",{staticClass:"page-item",on:{click:function(e){return t.goToPage(1)}}},[a("a",{staticClass:"page-link"},[t._v("\n 1\n ")])]):t._e(),t._v(" "),t._l(5,(function(e,s){return t.pageIndex<5?a("li",{key:s,staticClass:"page-item",on:{click:function(a){return t.goToPage(e)}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===e}},[t._v("\n "+t._s(e)+"\n ")])]):t._e()})),t._v(" "),t.pageIndex>=5?a("li",{staticClass:"page-item"},[a("a",{staticClass:"page-link"},[t._v("...")])]):t._e(),t._v(" "),t._l(t.floatPages,(function(e,s){return t.pageIndex>=5&&t.pageIndex<t.data.meta.last_page-3?a("li",{key:s,staticClass:"page-item",on:{click:function(a){return t.goToPage(e)}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===e}},[t._v("\n "+t._s(e)+"\n ")])]):t._e()})),t._v(" "),t.pageIndex<t.data.meta.last_page-3?a("li",{staticClass:"page-item"},[a("a",{staticClass:"page-link"},[t._v("...")])]):t._e(),t._v(" "),t._l(5,(function(e,s){return t.pageIndex>t.data.meta.last_page-4?a("li",{key:s,staticClass:"page-item",on:{click:function(e){t.goToPage(t.data.meta.last_page-(4-s))}}},[a("a",{staticClass:"page-link",class:{active:t.pageIndex===t.data.meta.last_page-(4-s)}},[t._v("\n "+t._s(t.data.meta.last_page-(4-s))+"\n ")])]):t._e()})),t._v(" "),t.pageIndex<t.data.meta.last_page-3?a("li",{staticClass:"page-item",on:{click:function(e){return t.goToPage(t.data.meta.last_page)}}},[a("a",{staticClass:"page-link"},[t._v("\n "+t._s(t.data.meta.last_page)+"\n ")])]):t._e(),t._v(" "),a("li",{staticClass:"page-item next"},[a("a",{staticClass:"page-link",class:{disabled:t.pageIndex+1==t.data.meta.last_page},on:{click:function(e){return t.goToPage(t.pageIndex+1)}}},[a("chevron-right-icon",{staticClass:"icon",attrs:{size:"14"}})],1)])],2):t._e(),t._v(" "),a("span",{staticClass:"mt-10 flex items-center justify-between text-xs text-gray-600"},[t._v("\n\t\t\t\tShowing "+t._s(t.data.meta.from)+" - "+t._s(t.data.meta.to)+" from "+t._s(t.data.meta.total)+" records\n\t\t\t")])]):t._e()],2)}),[],!1,null,"41f7bf1e",null));e.a=c.exports},J5CR:function(t,e,a){"use strict";a.r(e);var s=a("o0o1"),i=a.n(s),n=a("CjXH"),r=a("gBgQ"),o=a("6TPS"),l=a("A5+z"),p=a("gahf"),c=a("4TWA"),d=a("xxrA"),u=a("D+dh"),m=a("jH4x"),g=a("eZ9V"),v=a("Nv84"),y=a("PTF1"),f=a("13Td"),h=a("UD3w"),_=a("qefO"),b=a("KnjL"),k=a("TJPC"),w=a("xCqy"),C=a("L2JU"),x=a("vDqi"),$=a.n(x);function P(t,e,a,s,i,n,r){try{var o=t[n](r),l=o.value}catch(t){return void a(t)}o.done?e(l):Promise.resolve(l).then(s,i)}function S(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function I(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?S(Object(a),!0).forEach((function(e){T(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):S(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function T(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var D={name:"AppPayments",components:{AppInputButton:r.a,DatatableWrapper:o.a,ValidationObserver:l.ValidationObserver,ValidationProvider:l.ValidationProvider,AppInputSwitch:m.a,AppInputText:h.a,PageTabGroup:p.a,SwitchInput:d.a,SelectInput:c.a,ImageInput:u.a,ButtonBase:v.a,CopyInput:y.a,FormLabel:g.a,Trash2Icon:n.rb,Edit2Icon:n.y,SetupBox:f.a,required:k.a,PageTab:_.a,InfoBox:b.a},computed:I(I({},Object(C.b)(["subscriptionTypes","config"])),{},{submitButtonText:function(){return this.isLoading?this.$t("admin_settings.payments.button_testing"):this.$t("admin_settings.payments.button_submit")}}),data:function(){return{allowedRegistrationBonus:!0,registrationBonusAmount:void 0,allowedPayments:!1,isLoading:!1,isError:!1,errorMessage:"",stripe:{allowedService:!0,isConfigured:!1,isVisibleCredentialsForm:!1,paymentDescription:void 0,credentials:{key:void 0,secret:void 0,webhook:void 0}},paystack:{allowedService:!0,isConfigured:!1,isVisibleCredentialsForm:!1,paymentDescription:void 0,credentials:{key:void 0,secret:void 0}},paypal:{allowedService:!0,isConfigured:!1,isVisibleCredentialsForm:!1,paymentDescription:void 0,credentials:{key:void 0,secret:void 0,webhook:void 0}},columns:[{label:this.$t("Name"),field:"name",sortable:!0},{label:this.$t("Currency"),field:"currency",sortable:!0},{label:this.$t("Interval"),field:"interval",sortable:!0},{label:this.$t("admin_page_plans.table.subscribers"),sortable:!1},{label:this.$t("admin_page_user.table.action"),sortable:!1}]}},methods:{storeCredentials:function(t){var e,a=this;return(e=i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.$refs.credentialsForm.validate();case 2:if(e.sent){e.next=5;break}return e.abrupt("return");case 5:a.isLoading=!0,$.a.post("/api/admin/settings/payment-service",{service:t,key:a[t].credentials.key,secret:a[t].credentials.secret,webhook:a[t].credentials.webhook||void 0}).then((function(){var e={stripe:"SET_STRIPE_CREDENTIALS",paystack:"SET_PAYSTACK_CREDENTIALS",paypal:"SET_PAYPAL_CREDENTIALS"}[t];a.$store.commit(e,a[t].credentials),a[t].allowedService=!0,a[t].isConfigured=!0,a[t].isVisibleCredentialsForm=!1,w.a.$emit("toaster",{type:"success",message:a.$t("toaster.credentials_set",{service:t})})})).catch((function(t){500===t.response.status&&(a.isError=!0,a.errorMessage=t.response.data.message)})).finally((function(){return a.isLoading=!1}));case 7:case"end":return e.stop()}}),e)})),function(){var t=this,a=arguments;return new Promise((function(s,i){var n=e.apply(t,a);function r(t){P(n,s,i,r,o,"next",t)}function o(t){P(n,s,i,r,o,"throw",t)}r(void 0)}))})()},subscriptionTypeChange:function(t){w.a.$emit("confirm:open",{title:this.$t("Are you sure you want to change subscription type?"),message:this.$t("We strongly do not recommend change this value if there is any subscribed user to prevent any failures. You can operate only with one type of subscription and you can not change it on the fly!"),action:{type:t,operation:"change-subscription-type"}})},getWebhookEndpoint:function(t){return"".concat(this.config.host,"/api/subscriptions/").concat(t,"/webhook")}},mounted:function(){this.stripe.paymentDescription=this.config.stripe_payment_description,this.paystack.paymentDescription=this.config.paystack_payment_description,this.paypal.paymentDescription=this.config.paypal_payment_description,this.stripe.allowedService=this.config.isStripe,this.paystack.allowedService=this.config.isPaystack,this.paypal.allowedService=this.config.isPayPal,this.config.stripe_public_key&&(this.stripe.isConfigured=!0),this.config.paystack_public_key&&(this.paystack.isConfigured=!0),this.config.paypal_client_id&&(this.paypal.isConfigured=!0),this.allowedPayments=this.config.allowed_payments,this.allowedRegistrationBonus=this.config.allowed_registration_bonus,this.registrationBonusAmount=this.config.registration_bonus_amount},created:function(){var t=this;w.a.$on("action:confirmed",(function(e){"change-subscription-type"===e.operation&&t.$updateText("/admin/settings","subscription_type",e.type)}))},destroyed:function(){w.a.$off("action:confirmed")}},A=a("KHd+"),B=Object(A.a)(D,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("PageTab",[a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"dollar"}},[t._v("\n\t\t\t\t"+t._s(t.$t("Subscription Payments"))+"\n\t\t\t")]),t._v(" "),a("AppInputSwitch",{attrs:{title:t.$t("Allow Subscription Payments"),description:t.$t("User can subscribe to fixed or metered plan"),"is-last":!t.allowedPayments}},[a("SwitchInput",{attrs:{state:t.allowedPayments},on:{input:function(e){return t.$updateText("/admin/settings","allowed_payments",t.allowedPayments)}},model:{value:t.allowedPayments,callback:function(e){t.allowedPayments=e},expression:"allowedPayments"}})],1),t._v(" "),t.allowedPayments?a("AppInputText",{attrs:{title:t.$t("Subscription Type"),"is-last":!0}},[a("SelectInput",{attrs:{default:t.config.subscriptionType,options:t.subscriptionTypes,placeholder:t.$t("Select your subscription type")},on:{change:t.subscriptionTypeChange}})],1):t._e()],1),t._v(" "),"metered"===t.config.subscriptionType&&t.allowedPayments?a("div",{staticClass:"card shadow-card"},[a("FormLabel",{attrs:{icon:"bar-chart"}},[t._v("\n\t\t\t\t"+t._s(t.$t("Metered Billing Settings"))+"\n\t\t\t")]),t._v(" "),a("AppInputSwitch",{attrs:{title:t.$t("Allow Registration Bonus"),description:t.$t("Credit user automatically bonus to his balance after registration.")}},[a("SwitchInput",{attrs:{state:t.allowedRegistrationBonus},on:{input:function(e){return t.$updateText("/admin/settings","allowed_registration_bonus",t.allowedRegistrationBonus)}},model:{value:t.allowedRegistrationBonus,callback:function(e){t.allowedRegistrationBonus=e},expression:"allowedRegistrationBonus"}})],1),t._v(" "),t.allowedRegistrationBonus?a("AppInputText",{attrs:{title:t.$t("The Amount of Registration Bonus"),description:t.$t("This bonus will be automatically added when user successfully register his account.")}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.registrationBonusAmount,expression:"registrationBonusAmount"}],staticClass:"focus-border-theme input-dark",attrs:{placeholder:t.$t("Type registration bonus amount..."),type:"number"},domProps:{value:t.registrationBonusAmount},on:{input:[function(e){e.target.composing||(t.registrationBonusAmount=e.target.value)},function(e){return t.$updateText("/admin/settings","registration_bonus_amount",t.registrationBonusAmount)}]}})]):t._e(),t._v(" "),a("AppInputButton",{attrs:{title:t.$t("Metered Plan"),description:t.$t("Your price set up for billing multiple features by user usage."),"is-last":!0}},[t.config.isCreatedMeteredPlan?a("router-link",{attrs:{to:{name:"PlanMeteredSettings",params:{id:t.config.meteredPlanId}}}},[t.config.isCreatedMeteredPlan?a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{"button-style":"theme"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Plan Details"))+"\n\t\t\t\t\t")]):t._e()],1):t._e(),t._v(" "),t.config.isCreatedMeteredPlan?t._e():a("router-link",{attrs:{to:{name:"CreateMeteredPlan"}}},[a("ButtonBase",{staticClass:"sm:w-auto w-full",attrs:{"button-style":"theme-solid"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Create Plan"))+"\n\t\t\t\t\t")])],1)],1)],1):t._e(),t._v(" "),t.allowedPayments?a("div",{staticClass:"card shadow-card"},[a("img",{staticClass:"mb-8 h-8",attrs:{src:t.$getPaymentLogo("stripe"),alt:"Stripe"}}),t._v(" "),a("AppInputSwitch",{attrs:{title:t.$t("Allow Stripe Service"),description:t.$t("Allow your users pay by their credit card"),"is-last":!t.stripe.allowedService}},[a("SwitchInput",{attrs:{state:t.stripe.allowedService},on:{input:function(e){return t.$updateText("/admin/settings","allowed_stripe",t.stripe.allowedService)}},model:{value:t.stripe.allowedService,callback:function(e){t.$set(t.stripe,"allowedService",e)},expression:"stripe.allowedService"}})],1),t._v(" "),t.stripe.allowedService?a("div",[t.stripe.isConfigured?a("div",[a("AppInputText",{attrs:{title:t.$t("Payment Description"),description:t.$t("The description showed below user payment method selection.")},on:{input:function(e){return t.$updateText("/admin/settings","stripe_payment_description",t.stripe.paymentDescription)}}},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.stripe.paymentDescription,expression:"stripe.paymentDescription"}],staticClass:"focus-border-theme input-dark",attrs:{rows:"2",placeholder:t.$t("Describe in short which methods user can pay with this payment method..."),type:"text"},domProps:{value:t.stripe.paymentDescription},on:{input:[function(e){e.target.composing||t.$set(t.stripe,"paymentDescription",e.target.value)},function(e){return t.$updateText("/admin/settings","stripe_payment_description",t.stripe.paymentDescription,!0)}]}})]),t._v(" "),a("AppInputText",{attrs:{title:t.$t("Your Webhook URL"),description:t.$t("Please copy your url and paste it to the service webhook setup.")}},[a("CopyInput",{attrs:{size:"small",str:t.getWebhookEndpoint("stripe")}})],1),t._v(" "),a("div",{staticClass:"flex items-center cursor-pointer",class:{"mb-4":t.stripe.isVisibleCredentialsForm},on:{click:function(e){t.stripe.isVisibleCredentialsForm=!t.stripe.isVisibleCredentialsForm}}},[a("edit2-icon",{staticClass:"vue-feather text-theme mr-2.5",attrs:{size:"14"}}),t._v(" "),a("b",{staticClass:"text-sm"},[t._v(t._s(t.$t("Update Your Credentials")))])],1)],1):t._e(),t._v(" "),!t.stripe.isConfigured||t.stripe.isVisibleCredentialsForm?a("ValidationObserver",{ref:"credentialsForm",staticClass:"p-5 shadow-lg rounded-xl",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.storeCredentials("stripe")}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[t.stripe.isConfigured?t._e():a("FormLabel",{attrs:{icon:"shield"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Configure Your Credentials"))+"\n\t\t\t\t\t")]),t._v(" "),a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Publishable Key",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.errors;return[a("AppInputText",{attrs:{title:t.$t("admin_settings.payments.stripe_pub_key"),error:s[0]}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.stripe.credentials.key,expression:"stripe.credentials.key"}],staticClass:"focus-border-theme input-dark",class:{"border-red":s[0]},attrs:{placeholder:t.$t("admin_settings.payments.stripe_pub_key_plac"),type:"text"},domProps:{value:t.stripe.credentials.key},on:{input:function(e){e.target.composing||t.$set(t.stripe.credentials,"key",e.target.value)}}})])]}}],null,!0)}),t._v(" "),a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Secret Key",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.errors;return[a("AppInputText",{attrs:{title:t.$t("admin_settings.payments.stripe_sec_key"),error:s[0]}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.stripe.credentials.secret,expression:"stripe.credentials.secret"}],staticClass:"focus-border-theme input-dark",class:{"border-red":s[0]},attrs:{placeholder:t.$t("admin_settings.payments.stripe_sec_key_plac"),type:"text"},domProps:{value:t.stripe.credentials.secret},on:{input:function(e){e.target.composing||t.$set(t.stripe.credentials,"secret",e.target.value)}}})])]}}],null,!0)}),t._v(" "),a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Webhook Secret",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.errors;return[a("AppInputText",{attrs:{title:t.$t("Webhook Secret"),error:s[0]}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.stripe.credentials.webhook,expression:"stripe.credentials.webhook"}],staticClass:"focus-border-theme input-dark",class:{"border-red":s[0]},attrs:{placeholder:t.$t("Paste your webhook secret"),type:"text"},domProps:{value:t.stripe.credentials.webhook},on:{input:function(e){e.target.composing||t.$set(t.stripe.credentials,"webhook",e.target.value)}}})])]}}],null,!0)}),t._v(" "),a("ButtonBase",{staticClass:"w-full",attrs:{disabled:t.isLoading,loading:t.isLoading,"button-style":"theme",type:"submit"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Store Credentials"))+"\n\t\t\t\t\t")])]}}],null,!1,2440834818)}):t._e()],1):t._e()],1):t._e(),t._v(" "),t.allowedPayments?a("div",{staticClass:"card shadow-card"},[a("img",{staticClass:"mb-8 h-7",attrs:{src:t.$getPaymentLogo("paystack"),alt:"Paystack"}}),t._v(" "),a("AppInputSwitch",{attrs:{title:t.$t("Allow Paystack Service"),description:t.$t("Allow your users pay by their credit card"),"is-last":!t.paystack.allowedService}},[a("SwitchInput",{attrs:{state:t.paystack.allowedService},on:{input:function(e){return t.$updateText("/admin/settings","allowed_paystack",t.paystack.allowedService)}},model:{value:t.paystack.allowedService,callback:function(e){t.$set(t.paystack,"allowedService",e)},expression:"paystack.allowedService"}})],1),t._v(" "),t.paystack.allowedService?a("div",[t.paystack.isConfigured?a("div",[a("AppInputText",{attrs:{title:t.$t("Payment Description"),description:t.$t("The description showed below user payment method selection.")},on:{input:function(e){return t.$updateText("/admin/settings","paystack_payment_description",t.paystack.paymentDescription)}}},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.paystack.paymentDescription,expression:"paystack.paymentDescription"}],staticClass:"focus-border-theme input-dark",attrs:{rows:"2",placeholder:t.$t("Describe in short which methods user can pay with this payment method..."),type:"text"},domProps:{value:t.paystack.paymentDescription},on:{input:[function(e){e.target.composing||t.$set(t.paystack,"paymentDescription",e.target.value)},function(e){return t.$updateText("/admin/settings","paystack_payment_description",t.paystack.paymentDescription,!0)}]}})]),t._v(" "),a("AppInputText",{attrs:{title:t.$t("Your Webhook URL"),description:t.$t("Please copy your url and paste it to the service webhook setup.")}},[a("CopyInput",{attrs:{size:"small",str:t.getWebhookEndpoint("paystack")}})],1),t._v(" "),a("div",{staticClass:"flex items-center cursor-pointer",class:{"mb-4":t.paystack.isVisibleCredentialsForm},on:{click:function(e){t.paystack.isVisibleCredentialsForm=!t.paystack.isVisibleCredentialsForm}}},[a("edit2-icon",{staticClass:"vue-feather text-theme mr-2.5",attrs:{size:"14"}}),t._v(" "),a("b",{staticClass:"text-sm"},[t._v(t._s(t.$t("Update Your Credentials")))])],1)],1):t._e(),t._v(" "),!t.paystack.isConfigured||t.paystack.isVisibleCredentialsForm?a("ValidationObserver",{ref:"credentialsForm",staticClass:"p-5 shadow-lg rounded-xl",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.storeCredentials("paystack")}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[t.paystack.isConfigured?t._e():a("FormLabel",{attrs:{icon:"shield"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Configure Your Credentials"))+"\n\t\t\t\t\t")]),t._v(" "),a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Publishable Key",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.errors;return[a("AppInputText",{attrs:{title:t.$t("admin_settings.payments.stripe_pub_key"),error:s[0]}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.paystack.credentials.key,expression:"paystack.credentials.key"}],staticClass:"focus-border-theme input-dark",class:{"border-red":s[0]},attrs:{placeholder:t.$t("admin_settings.payments.stripe_pub_key_plac"),type:"text"},domProps:{value:t.paystack.credentials.key},on:{input:function(e){e.target.composing||t.$set(t.paystack.credentials,"key",e.target.value)}}})])]}}],null,!0)}),t._v(" "),a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Secret Key",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.errors;return[a("AppInputText",{attrs:{title:t.$t("admin_settings.payments.stripe_sec_key"),error:s[0]}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.paystack.credentials.secret,expression:"paystack.credentials.secret"}],staticClass:"focus-border-theme input-dark",class:{"border-red":s[0]},attrs:{placeholder:t.$t("admin_settings.payments.stripe_sec_key_plac"),type:"text"},domProps:{value:t.paystack.credentials.secret},on:{input:function(e){e.target.composing||t.$set(t.paystack.credentials,"secret",e.target.value)}}})])]}}],null,!0)}),t._v(" "),a("ButtonBase",{staticClass:"w-full",attrs:{disabled:t.isLoading,loading:t.isLoading,"button-style":"theme",type:"submit"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Store Credentials"))+"\n\t\t\t\t\t")])]}}],null,!1,1345656049)}):t._e()],1):t._e()],1):t._e(),t._v(" "),t.allowedPayments?a("div",{staticClass:"card shadow-card"},[a("img",{staticClass:"mb-8 h-8",attrs:{src:t.$getPaymentLogo("paypal"),alt:"PayPal"}}),t._v(" "),a("AppInputSwitch",{attrs:{title:t.$t("Allow PayPal Service"),description:t.$t("Allow your users pay by their credit card"),"is-last":!t.paypal.allowedService}},[a("SwitchInput",{attrs:{state:t.paypal.allowedService},on:{input:function(e){return t.$updateText("/admin/settings","allowed_paypal",t.paypal.allowedService)}},model:{value:t.paypal.allowedService,callback:function(e){t.$set(t.paypal,"allowedService",e)},expression:"paypal.allowedService"}})],1),t._v(" "),t.paypal.allowedService?a("div",[t.paypal.isConfigured?a("div",[a("AppInputText",{attrs:{title:t.$t("Payment Description"),description:t.$t("The description showed below user payment method selection.")},on:{input:function(e){return t.$updateText("/admin/settings","paypal_payment_description",t.paypal.paymentDescription)}}},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:t.paypal.paymentDescription,expression:"paypal.paymentDescription"}],staticClass:"focus-border-theme input-dark",attrs:{rows:"2",placeholder:t.$t("Describe in short which methods user can pay with this payment method..."),type:"text"},domProps:{value:t.paypal.paymentDescription},on:{input:[function(e){e.target.composing||t.$set(t.paypal,"paymentDescription",e.target.value)},function(e){return t.$updateText("/admin/settings","paypal_payment_description",t.paypal.paymentDescription,!0)}]}})]),t._v(" "),a("AppInputText",{attrs:{title:t.$t("Your Webhook URL"),description:t.$t("Please copy your url and paste it to the service webhook setup.")}},[a("CopyInput",{attrs:{size:"small",str:t.getWebhookEndpoint("paypal")}})],1),t._v(" "),a("div",{staticClass:"flex items-center cursor-pointer",class:{"mb-4":t.paypal.isVisibleCredentialsForm},on:{click:function(e){t.paypal.isVisibleCredentialsForm=!t.paypal.isVisibleCredentialsForm}}},[a("edit2-icon",{staticClass:"vue-feather text-theme mr-2.5",attrs:{size:"14"}}),t._v(" "),a("b",{staticClass:"text-sm"},[t._v(t._s(t.$t("Update Your Credentials")))])],1)],1):t._e(),t._v(" "),!t.paypal.isConfigured||t.paypal.isVisibleCredentialsForm?a("ValidationObserver",{ref:"credentialsForm",staticClass:"p-5 shadow-lg rounded-xl",attrs:{tag:"form"},on:{submit:function(e){return e.preventDefault(),t.storeCredentials("paypal")}},scopedSlots:t._u([{key:"default",fn:function(e){e.invalid;return[t.paypal.isConfigured?t._e():a("FormLabel",{attrs:{icon:"shield"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Configure Your Credentials"))+"\n\t\t\t\t\t")]),t._v(" "),a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Publishable Key",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.errors;return[a("AppInputText",{attrs:{title:t.$t("admin_settings.payments.stripe_pub_key"),error:s[0]}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.paypal.credentials.key,expression:"paypal.credentials.key"}],staticClass:"focus-border-theme input-dark",class:{"border-red":s[0]},attrs:{placeholder:t.$t("admin_settings.payments.stripe_pub_key_plac"),type:"text"},domProps:{value:t.paypal.credentials.key},on:{input:function(e){e.target.composing||t.$set(t.paypal.credentials,"key",e.target.value)}}})])]}}],null,!0)}),t._v(" "),a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Secret Key",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.errors;return[a("AppInputText",{attrs:{title:t.$t("admin_settings.payments.stripe_sec_key"),error:s[0]}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.paypal.credentials.secret,expression:"paypal.credentials.secret"}],staticClass:"focus-border-theme input-dark",class:{"border-red":s[0]},attrs:{placeholder:t.$t("admin_settings.payments.stripe_sec_key_plac"),type:"text"},domProps:{value:t.paypal.credentials.secret},on:{input:function(e){e.target.composing||t.$set(t.paypal.credentials,"secret",e.target.value)}}})])]}}],null,!0)}),t._v(" "),a("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Webhook ID",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.errors;return[a("AppInputText",{attrs:{title:t.$t("Webhook ID"),error:s[0]}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.paypal.credentials.webhook,expression:"paypal.credentials.webhook"}],staticClass:"focus-border-theme input-dark",class:{"border-red":s[0]},attrs:{placeholder:t.$t("Paste your webhook id"),type:"text"},domProps:{value:t.paypal.credentials.webhook},on:{input:function(e){e.target.composing||t.$set(t.paypal.credentials,"webhook",e.target.value)}}})])]}}],null,!0)}),t._v(" "),a("ButtonBase",{staticClass:"w-full",attrs:{disabled:t.isLoading,loading:t.isLoading,"button-style":"theme",type:"submit"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.$t("Store Credentials"))+"\n\t\t\t\t\t")])]}}],null,!1,3831966373)}):t._e()],1):t._e()],1):t._e()])}),[],!1,null,null,null);e.default=B.exports},PTF1:function(t,e,a){"use strict";var s=a("CjXH"),i={name:"CopyInput",props:["size","str"],components:{CheckIcon:s.g,CopyIcon:s.q,SendIcon:s.ib},data:function(){return{isCopiedLink:!1,id:"link-input-"+Math.floor(1e7*Math.random())}},methods:{copyUrl:function(){var t=this,e=document.getElementById(this.id);e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),this.isCopiedLink=!0,setTimeout((function(){t.isCopiedLink=!1}),1e3)}}},n=a("KHd+"),r=Object(n.a)(i,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"flex items-center relative",on:{click:t.copyUrl}},[a("input",{ref:"sel",staticClass:"pr-8 focus-border-theme input-dark",attrs:{id:t.id,type:"text",readonly:""},domProps:{value:t.str}}),t._v(" "),a("div",{staticClass:"absolute right-0 px-4"},[t.isCopiedLink?t._e():a("copy-icon",{staticClass:"cursor-pointer hover-text-theme vue-feather",attrs:{size:"16"}}),t._v(" "),t.isCopiedLink?a("check-icon",{staticClass:"cursor-pointer text-theme vue-feather",attrs:{size:"16"}}):t._e()],1)])}),[],!1,null,null,null);e.a=r.exports},T0k5:function(t,e,a){var s=a("uv/y");"string"==typeof s&&(s=[[t.i,s,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,i);s.locals&&(t.exports=s.locals)},VYZZ:function(t,e,a){var s=a("XSq/");"string"==typeof s&&(s=[[t.i,s,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(s,i);s.locals&&(t.exports=s.locals)},"XSq/":function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,".page-item[data-v-41f7bf1e]{padding:3px;display:inline-block}.page-link[data-v-41f7bf1e]{width:30px;height:30px;display:block;color:#1b2539;border-radius:6px;text-align:center;line-height:2.4;font-weight:700;font-size:13px;cursor:pointer;transition:all .15s ease}.page-link .icon[data-v-41f7bf1e]{vertical-align:middle;margin-top:-2px}.page-link.active[data-v-41f7bf1e],.page-link[data-v-41f7bf1e]:hover:not(.disabled){background:#f4f5f6;color:#1b2539}.page-link.disabled[data-v-41f7bf1e]{background:transparent;cursor:default}.page-link.disabled svg path[data-v-41f7bf1e]{fill:rgba(27,37,57,.7)}",""])},jWOf:function(t,e,a){"use strict";a("VYZZ")},"uv/y":function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,".table-row[data-v-d6678dd0]{border-radius:8px}.table-row[data-v-d6678dd0]:hover{background:#f4f5f6}.table-row .table-cell[data-v-d6678dd0]{padding-top:15px;padding-bottom:15px}.table-row .table-cell[data-v-d6678dd0]:first-child{padding-left:15px}.table-row .table-cell[data-v-d6678dd0]:last-child{padding-right:15px;text-align:right}.table-row .table-cell span[data-v-d6678dd0]{font-size:1em;font-weight:700}",""])}}]);