https://tenischile.com/_next/static/chunks/pages/arriendos/confirm-payment/[pid]-88a84a0b317c5bd3.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4061],{1398:(e,a,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/arriendos/confirm-payment/[pid]",function(){return s(62650)}])},62650:(e,a,s)=>{"use strict";s.r(a),s.d(a,{default:()=>o});var n=s(37876),r=s(14232),t=s(21518),l=s(89099),i=s(5068),c=s(56557),d=s.n(c);function o(){var e;let a=(0,l.useRouter)(),{pid:s,token_ws:t,TBK_TOKEN:c}=a.query,[o,m]=(0,r.useState)(null),[x,u]=(0,r.useState)(!0);if((0,r.useEffect)(()=>{if(a.isReady&&s){if(!t){m({error:c?"El pago fue cancelado.":"No se recibi\xf3 la confirmaci\xf3n de Transbank."}),u(!1);return}(async()=>{try{let e=await i.A.get("/api/arriendos/confirm-payment/".concat(s,"?token_ws=").concat(t));m(e.data)}catch(s){var e,a;console.error(s),m({error:(null==(a=s.response)||null==(e=a.data)?void 0:e.message)||"Error de conexi\xf3n con el servidor"})}finally{u(!1)}})()}},[a.isReady,s,t,c]),x)return(0,n.jsxs)("div",{className:"container mx-auto p-10 text-center",children:[(0,n.jsx)("h2",{className:"text-2xl mb-4",children:"Verificando tu pago de arriendo..."}),(0,n.jsx)("i",{className:"fas fa-circle-notch animate-spin text-4xl text-special-green"})]});if((null==o?void 0:o.error)||!(null==o?void 0:o.response))return(0,n.jsxs)("div",{className:"container mx-auto p-10 text-center",children:[(0,n.jsx)("h2",{className:"text-3xl text-red-600 mb-4",children:"\xa1Ups! Hubo un problema"}),(0,n.jsx)("p",{className:"text-xl mb-6",children:(null==o?void 0:o.error)||"La transacci\xf3n no pudo ser completada."}),(0,n.jsx)("div",{className:"flex gap-4 justify-center",children:(0,n.jsx)("button",{type:"button",onClick:()=>a.push("/arriendos"),className:"mt-8 bg-black hover:bg-gray-800 text-white px-6 py-3 rounded transition-all",children:"Volver a Arriendos"})})]});let{arriendo:p,response:h}=o;return(0,n.jsx)("div",{className:"container mx-auto p-10",children:(0,n.jsxs)("div",{className:"max-w-2xl mx-auto bg-white shadow-lg rounded-lg p-8 border-t-8 border-special-green",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-center mb-6",children:"\xa1Reserva Confirmada!"}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex justify-between border-b pb-2",children:[(0,n.jsx)("span",{className:"font-bold",children:"Club"}),(0,n.jsx)("span",{children:p.Field.Club.name})]}),(0,n.jsxs)("div",{className:"flex justify-between border-b pb-2",children:[(0,n.jsx)("span",{className:"font-bold",children:"Cancha"}),(0,n.jsxs)("span",{children:[p.Field.name," (",p.Field.kind.toUpperCase(),")"]})]}),(0,n.jsxs)("div",{className:"flex justify-between border-b pb-2",children:[(0,n.jsx)("span",{className:"font-bold",children:"Fecha"}),(0,n.jsx)("span",{children:d()(p.start_time).format("DD/MM/YYYY")})]}),(0,n.jsxs)("div",{className:"flex justify-between border-b pb-2",children:[(0,n.jsx)("span",{className:"font-bold",children:"Horario"}),(0,n.jsxs)("span",{children:[d()(p.start_time).format("HH:mm")," - ",d()(p.end_time).format("HH:mm")]})]}),(0,n.jsxs)("div",{className:"flex justify-between border-b pb-2",children:[(0,n.jsx)("span",{className:"font-bold",children:"Monto Pagado"}),(0,n.jsxs)("span",{className:"text-special-green font-bold",children:["$",p.amount.toLocaleString("es-CL")]})]}),(0,n.jsxs)("div",{className:"mt-8 pt-4",children:[(0,n.jsx)("h3",{className:"text-lg font-bold mb-4",children:"Detalles de Transacci\xf3n"}),(0,n.jsxs)("div",{className:"text-sm text-gray-600 space-y-1",children:[(0,n.jsxs)("p",{children:["C\xf3digo de autorizaci\xf3n: ",h.authorization_code]}),(0,n.jsxs)("p",{children:["Orden de compra: ",h.buy_order]}),(0,n.jsxs)("p",{children:["Tarjeta: **** **** **** ",null==(e=h.card_detail)?void 0:e.card_number]}),(0,n.jsxs)("p",{children:["Fecha pago: ",d()(h.transaction_date).format("DD/MM/YYYY HH:mm")]})]})]})]}),(0,n.jsxs)("div",{className:"mt-10 text-center",children:[(0,n.jsx)("button",{type:"button",onClick:()=>window.print(),className:"bg-gray-200 text-gray-800 px-4 py-2 rounded mr-4",children:"Imprimir Comprobante"}),(0,n.jsx)("button",{type:"button",onClick:()=>a.push("/"),className:"bg-black text-white px-6 py-2 rounded",children:"Volver al Inicio"})]})]})})}o.layout=t.A},82198:(e,a,s)=>{"use strict";s.d(a,{A:()=>i});var n=s(14232),r=s(89099),t=s.n(r),l=s(35070);function i(){let{redirectTo:e="",redirectIfFound:a=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:s,mutate:r}=(0,l.u)("/api/user",null,{revalidateOnFocus:!1,revalidateOnReconnect:!1,revalidateIfStale:!1,revalidateOnMount:!0,refreshInterval:0});return(0,n.useEffect)(()=>{e&&s&&(e&&!a&&!(null==s?void 0:s.isLoggedIn)||a&&(null==s?void 0:s.isLoggedIn))&&t().push(e)},[s,a,e]),{user:s,mutateUser:r}}}},e=>{e.O(0,[8096,1518,636,8792],()=>e(e.s=1398)),_N_E=e.O()}]);
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.