1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Options-B1s3eiZy.js","assets/index-sUPB-bMu.js","assets/index-CjsJg3P0.css","assets/validateRegistrationForPayment-33AxiamO.js","assets/Options-BgBnIJy4.css","assets/PlanData-DjCGUOBd.js","assets/PlanData-CSMZcKcU.css"])))=>i.map(i=>d[i]); 2import{_ as m,m as _,j as P,k as i,b as c,c as y,o as C,g as r,a as e,w as E,Z as f,t as n,p as l}from"./index-sUPB-bMu.js";const k=i(()=>l(()=>import("./Options-B1s3eiZy.js"),__vite__mapDeps([0,1,2,3,4]))),A=i(()=>l(()=>import("./PlanData-DjCGUOBd.js"),__vite__mapDeps([5,1,2,6]))),v={name:"CheckoutInPeacePlay",components:{PlanData:A,CheckoutMethodOptions:k},data(){return{paymentError:{type:null,message:null}}},computed:{...P(["userInpeaceAccount","churchData","churchPaymentMethods","inpcPlayPlans","inpcPlayCheckoutData","inpcPlayValidSubscription"]),planData(){return this.inpcPlayPlans.find(t=>t.id===this.inpcPlayCheckoutData.planId)},finalValue(){return Number(Number(this.inpcPlayCheckoutData.value)+Number(this.planData.taxaContratacao)).toFixed(2)},paymentMethods(){const t={metodosPagamento:[],isFree:!1};return Number(this.finalValue)===0&&(t.isFree=!0),t.metodosPagamento=this.churchPaymentMethods.metodosPagamento.filter(a=>a.flagPermitirAssinatura).filter(a=>a.codigoMetodoPagamento!=="PIX"),t}},mounted(){this.bootstrapCheckout()},methods:{..._(["appSetLoadingState","inpcPlayGetUserSubscriptions","checkoutPostInpcPlaySubscription","setChallengeComplete"]),async bootstrapCheckout(){if(this.validateAccess()){this.appSetLoadingState({context:"GLOBAL",status:!0});try{await this.inpcPlayGetUserSubscriptions()}catch{}finally{this.validateAccess(),this.appSetLoadingState({context:"GLOBAL",status:!1})}}},validateAccess(){return!this.inpcPlayCheckoutData||this.inpcPlayValidSubscription?(this.$router.replace({name:"inpcPlayPlans"}),!1):!0},formattedValue(t){return this.$getNumberWithCurrency(t,this.churchData.moeda)},mountPaymentData(t){return{usuario:this.userInpeaceAccount.id,planoAssinatura:this.inpcPlayCheckoutData.planId,metodoPagamento:t.metodoPagamento,cartao:"cartao"in t?t.cartao:null,picpay:"picpay"in t?t.picpay:null,valor:Number(this.finalValue),salvarCartao:"salvarCartao"in t?t.salvarCartao:!1}},async makePayment(t){try{await this.checkoutPostInpcPlaySubscription(this.mountPaymentData(t)),this.checkoutMethod==="CREDIT_CARD"&&this.setChallengeComplete(!1),await this.$router.replace({name:"checkoutSuccess"}).catch(()=>{})}catch(a){if(a.response){let o;switch(a.response.status){case 400:case 404:case 500:o=`${a.response.data.error.message}`;break;default:o=this.$t("FORM.MESSAGE.ERROR.GENERIC_ERROR");break}this.paymentError={type:"error",message:o};return}this.paymentError={type:"error",message:this.$t("FORM.MESSAGE.ERROR.GENERIC_ERROR")}}}}},g={"padded-content":!0,class:"checkout-inpcplay"},D={class:"checkout-inpcplay__plan"},M={class:"plan-data"},R={class:"checkout-inpcplay__value"},N={class:"text"},S={class:"value"},T={class:"value"},b={class:"checkout-inpcplay__methods"},O={class:"white-card__small-title"},I={class:"title"};function L(t,a,o,V,u,s){const h=c("PageContentHeader"),p=c("PlanData"),d=c("CheckoutMethodOptions");return C(),y("div",g,[r(h,{padded:!0},{default:E(()=>[f(n(t.$t("INPEACE_PLAY.CHECKOUT.TEXT.PAYMENT.PLAN")),1)]),_:1}),e("div",D,[e("div",M,[r(p,{data:s.planData,"no-hover":!0},null,8,["data"])])]),e("div",R,[e("div",N,n(t.$t("INPEACE_PLAY.CHECKOUT.TEXT.PAYMENT.TOTAL")),1),e("div",S,[e("div",T,n(s.formattedValue(s.finalValue)),1)])]),e("div",b,[e("div",O,[e("h3",I,n(t.$t("INPEACE_PLAY.CHECKOUT.TEXT.PAYMENT.PAYMENT")),1)]),r(d,{key:"inpeace_play","accepted-methods":s.paymentMethods,"payment-error":u.paymentError,"value-is-valid":!0,onMakePayment:s.makePayment},null,8,["accepted-methods","payment-error","onMakePayment"])])])}const w=m(v,[["render",L]]);export{w as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.