PageSourceSearch

https://itconnect.dev/assets/CheckoutSuccess-Darqy6jd.js

js itconnect.dev collected 2026-10-08 09:23:29 UTC 8,457 bytes, 1 lines download raw bytes

1import{v,r as n,j as e,L as i}from"./index-f3Er14TH.js";import{l as b}from"./checkoutSession-DAN9IAlp.js";import{g as N}from"./errorMessages-C7Va5L4Q.js";import{a as k}from"./ordersApi-hpjVEbGJ.js";import{g as w}from"./programSchedule-B-Kyj00n.js";const _=new Intl.NumberFormat("ko-KR");function y(s){return`${_.format(s)}원`}function W(s){return s.get("orderId")??s.get("checkoutOrderId")}function C(s){const r=s.get("amount");if(!r)return null;const a=Number(r);return Number.isFinite(a)?a:null}function $(){const[s]=v(),r=W(s),a=s.get("paymentKey"),c=C(s),[t,d]=n.useState(null),[l,g]=n.useState(null),[x,p]=n.useState(null),[j,u]=n.useState(!1),m=n.useRef(null);if(n.useEffect(()=>{if(!r){d(null);return}d(b(r))},[r]),n.useEffect(()=>{if(!r||!t||!a||c===null)return;const f=`${a}:${c}:${r}`;m.current!==f&&(m.current=f,u(!0),p(null),k({order_id:r,checkout_token:t.checkout_token,payment_key:a,amount:c}).then(o=>{g(o)}).catch(o=>{p(N(o,"결제를 승인하지 못했습니다."))}).finally(()=>{u(!1)}))},[c,t,r,a]),!r||!t)return e.jsx("div",{className:"min-h-screen px-6 py-16",style:{background:"var(--paper)"},children:e.jsxs("div",{className:"mx-auto flex w-full max-w-[780px] flex-col gap-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[13px] uppercase tracking-[0.14em]",style:{color:"var(--text-tertiary)"},children:"Payment Result"}),e.jsx("h1",{className:"text-[32px] leading-[1.1] tracking-tight",style:{color:"var(--brand-ink)",fontFamily:"var(--font-serif)"},children:"결제 결과 정보를 찾을 수 없습니다."}),e.jsx("p",{className:"text-[15px] leading-7",style:{color:"var(--text-soft)"},children:"수강 신청 화면에서 주문을 다시 준비한 뒤 결제를 진행해 주세요."})]}),e.jsx(i,{to:"/program",className:"inline-flex w-fit items-center justify-center rounded-lg px-4 py-3 text-[14px] text-white",style:{background:"var(--brand-blue)",fontWeight:600},children:"프로그램 페이지로 돌아가기"})]})});const h=`/program/${w(t.program_type)}/enroll?scheduleId=${t.schedule_id}`;return!a||c===null?e.jsx("div",{className:"min-h-screen px-6 py-16",style:{background:"var(--paper)"},children:e.jsxs("div",{className:"mx-auto flex w-full max-w-[840px] flex-col gap-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[13px] uppercase tracking-[0.14em]",style:{color:"var(--text-tertiary)"},children:"Payment Result"}),e.jsx("h1",{className:"text-[32px] leading-[1.1] tracking-tight",style:{color:"var(--brand-ink)",fontFamily:"var(--font-serif)"},children:"결제 승인 정보를 확인할 수 없습니다."}),e.jsx("p",{className:"text-[15px] leading-7",style:{color:"var(--text-soft)"},children:"결제 완료 콜백 정보가 누락되어 주문을 확정하지 못했습니다. 수강 신청 화면에서 다시 시도해 주세요."})]}),e.jsx(i,{to:h,className:"inline-flex w-fit items-center justify-center rounded-lg px-4 py-3 text-[14px] text-white",style:{background:"var(--brand-blue)",fontWeight:600},children:"다시 시도"})]})}):e.jsx("div",{className:"min-h-screen px-6 py-16",style:{background:"var(--paper)"},children:e.jsxs("div",{className:"mx-auto flex w-full max-w-[1080px] flex-col gap-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-[13px] uppercase tracking-[0.14em]",style:{color:"var(--text-tertiary)"},children:"Payment Result"}),e.jsx("h1",{className:"text-[32px] leading-[1.1] tracking-tight",style:{color:"var(--brand-ink)",fontFamily:"var(--font-serif)"},children:l?"결제가 완료되었습니다.":"결제를 확인하고 있습니다."}),e.jsx("p",{className:"max-w-3xl text-[15px] leading-7",style:{color:"var(--text-soft)"},children:l?"주문과 수강 등록이 확정되었습니다. 새로고침해도 같은 주문 결과를 안정적으로 다시 확인할 수 있습니다.":"Toss 승인 결과와 서버 트랜잭션을 다시 대조해 주문을 확정하고 있습니다."})]}),x?e.jsxs("section",{className:"rounded-[28px] border px-6 py-6 sm:px-7 sm:py-7",style:{background:"rgba(196,91,91,0.12)",borderColor:"rgba(196,91,91,0.18)"},children:[e.jsx("p",{className:"text-[16px]",style:{color:"#9f2d2d",fontWeight:700},children:"결제를 완료 처리하지 못했습니다."}),e.jsx("p",{className:"mt-3 text-[14px] leading-7",style:{color:"#9f2d2d"},children:x}),e.jsxs("div",{className:"mt-5 flex flex-wrap gap-3",children:[e.jsx(i,{to:h,className:"inline-flex items-center justify-center rounded-[18px] px-4 py-3 text-[14px] text-white",style:{background:"var(--brand-blue)",fontWeight:700},children:"수강 신청 화면으로 돌아가기"}),e.jsx(i,{to:`/checkout/${r}`,className:"inline-flex items-center justify-center rounded-[18px] border px-4 py-3 text-[14px]",style:{borderColor:"var(--line-faint)",color:"var(--text-secondary)"},children:"체크아웃으로 돌아가기"})]})]}):null,e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.02fr_0.98fr]",children:[e.jsx("section",{className:"rounded-[32px] border px-6 py-7 sm:px-8",style:{background:"radial-gradient(circle at top, rgba(111,137,
1132,0.24), rgba(255,255,255,0.96) 62%)",borderColor:"rgba(111,137,132,0.2)"},children:e.jsxs("div",{className:"flex flex-col items-start gap-5",children:[e.jsxs("div",{className:"relative flex h-24 w-24 items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 rounded-full animate-pulse",style:{background:"rgba(111,137,132,0.18)"}}),e.jsx("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-full text-[34px]",style:{background:"var(--accent-teal)",color:"white",fontWeight:700},children:"✓"})]}),j&&!l?e.jsx("p",{className:"text-[15px] leading-7",style:{color:"var(--text-soft)"},children:"결제 승인과 주문 확정을 확인하는 중입니다."}):null,l?e.jsxs("div",{className:"w-full space-y-4",children:[e.jsx("p",{className:"text-[16px]",style:{color:"var(--accent-teal)",fontWeight:700},children:"주문과 수강 등록이 완료되었습니다."}),e.jsxs("div",{className:"space-y-2 text-[14px] leading-7",style:{color:"var(--text-secondary)"},children:[e.jsxs("p",{children:["주문번호 ",e.jsx("span",{style:{fontWeight:700},children:l.order_id})]}),e.jsxs("p",{children:["프로그램"," ",e.jsx("span",{style:{fontWeight:700},children:t.program_name})]}),e.jsxs("p",{children:["일정 ",e.jsx("span",{style:{fontWeight:700},children:l.schedule_date})]}),e.jsxs("p",{children:["결제 금액"," ",e.jsx("span",{style:{fontWeight:700},children:y(l.final_amount)})]}),e.jsxs("p",{children:["결제 상태 ",e.jsx("span",{style:{fontWeight:700},children:l.status})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 pt-2",children:[l.receipt_url?e.jsx("a",{href:l.receipt_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center justify-center rounded-[18px] border px-4 py-3 text-[14px]",style:{borderColor:"var(--line-faint)",color:"var(--brand-blue)",fontWeight:700},children:"영수증 보기"}):null,e.jsx(i,{to:"/mypage",className:"inline-flex items-center justify-center rounded-[18px] px-4 py-3 text-[14px] text-white",style:{background:"var(--brand-blue)",fontWeight:700},children:"My Page에서 확인하기"})]})]}):null]})}),e.jsxs("section",{className:"rounded-[28px] border px-6 py-6 sm:px-7 sm:py-7",style:{background:"rgba(255,255,255,0.94)",borderColor:"var(--line-faint)"},children:[e.jsx("p",{className:"text-[12px] uppercase tracking-[0.14em]",style:{color:"var(--text-tertiary)"},children:"Order Summary"}),e.jsx("h2",{className:"mt-2 text-[24px] leading-[1.15] tracking-tight",style:{color:"var(--brand-ink)",fontFamily:"var(--font-serif)"},children:t.program_name}),e.jsxs("div",{className:"mt-6 space-y-4 text-[14px] leading-7",style:{color:"var(--text-soft)"},children:[e.jsxs("div",{children:[e.jsx("p",{style:{color:"var(--text-tertiary)"},children:"일정"}),e.jsx("p",{style:{color:"var(--text-primary)",fontWeight:700},children:t.schedule_title}),e.jsx("p",{children:t.schedule_date})]}),e.jsxs("div",{children:[e.jsx("p",{style:{color:"var(--text-tertiary)"},children:"결제 금액"}),e.jsx("p",{style:{color:"var(--text-primary)",fontWeight:700},children:y(t.final_amount)})]}),t.coupon_code?e.jsxs("div",{children:[e.jsx("p",{style:{color:"var(--text-tertiary)"},children:"적용 쿠폰"}),e.jsx("p",{style:{color:"var(--brand-blue)",fontWeight:700},children:t.coupon_code})]}):null]})]})]})]})})}export{$ 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.