PageSourceSearch

https://luyentu.com/assets/PaymentSuccess.U_vVoTkB.js

js luyentu.com collected 2026-10-02 01:35:20 UTC 6,334 bytes, 1 lines download raw bytes

1import{X as C,W as I,u as S,r as P,j as t,S as R,bi as v,aT as T,ci as E,x as L,b9 as N,cA as G,cW as j}from"./index.BvQk7nKY.js";import{A as M}from"./aiLimits.r21eA_M9.js";const k=5,B=1500,W=["thanh toan chua hoan tat","thanh toán chưa hoàn tất","payment is not complete","payment is not completed","payment is not confirmed"],q=["cancelled","canceled","expired","đã hủy","da huy","hết hạn","het han"],F=e=>new Promise(o=>setTimeout(o,e)),O=e=>String(e?.response?.data?.message||e?.response?.data?.error||e?.message||"").toLowerCase(),V=e=>{const o=O(e);if(q.some(s=>o.includes(s)))return!1;if(!e?.response)return!0;const r=Number(e.response.status);return[408,425,429].includes(r)||r>=500&&r<=599?!0:r===400&&W.some(s=>o.includes(s))};async function H({orderCode:e,activateByOrder:o,refreshUser:r,wait:s=F}){if(!e)return"error";let l=!1;for(let m=1;m<=k;m+=1)try{await o(e),l=!0;break}catch(b){if(!(m<k)||!V(b))return"error";await s(B)}if(!l)return"error";try{return await r(),"success"}catch{return"error"}}const Y="_pageWrapper_1ug9u_3",$="_bgGlow_1ug9u_14",X="_confetti_1ug9u_50",D="_confettiPiece_1ug9u_58",Q="_card_1ug9u_154",U="_iconWrapper_1ug9u_184",z="_checkIcon_1ug9u_229",J="_title_1ug9u_235",K="_subtitle_1ug9u_242",Z="_processingRow_1ug9u_250",tt="_processingText_1ug9u_261",nt="_spinIcon_1ug9u_267",et="_benefitsCard_1ug9u_282",st="_benefitsTitle_1ug9u_295",ct="_benefitsList_1ug9u_305",at="_benefitItem_1ug9u_311",ot="_benefitCheck_1ug9u_319",rt="_buttonsRow_1ug9u_326",it="_primaryBtn_1ug9u_333",ht="_secondaryBtn_1ug9u_360",n={pageWrapper:Y,bgGlow:$,confetti:X,confettiPiece:D,card:Q,iconWrapper:U,checkIcon:z,title:J,subtitle:K,processingRow:Z,processingText:tt,spinIcon:nt,benefitsCard:et,benefitsTitle:st,benefitsList:ct,benefitItem:at,benefitCheck:ot,buttonsRow:rt,primaryBtn:it,secondaryBtn:ht};function pt(){const[e]=C(),o=I(),{refreshUser:r}=S(),[s,l]=P.useState("processing"),[m,b]=P.useState(null),h=e.get("orderCode"),_=e.get("type"),f=e.get("classroomId"),i=_==="classroom",a=_==="classroom-student-pro",y=i||a;P.useEffect(()=>{(async()=>{if(!h){l("error");return}try{if(a&&f)await N.activateStudentProPayment(f,h);else if(i){let c=null,g=null;for(let d=0;d<5;d+=1)try{d>0&&await new Promise(A=>setTimeout(A,1500));const p=await N.activatePayment(h);c=p?.data?.data||p?.data||null;break}catch(p){g=p}if(!c)throw g||new Error("Payment is not confirmed yet");b(c)}else{let c=null;const g=await H({orderCode:h,activateByOrder:async d=>{const p=await G.activateByOrder(d);return c=p?.data?.data||null,p},refreshUser:r});l(g),g==="success"&&j({orderCode:h,value:c?.price,contentType:"subscription",contentName:c?.type});return}l("success"),j({orderCode:h,contentType:_||"classroom"})}catch{l("error")}})()},[f,i,y,a,h,_,r]);const w=a?["Pro đã được kích hoạt cho học sinh sau khi hệ thống xác nhận thanh toán.","Giáo viên có thể quay lại danh sách thành viên để kiểm tra hạn Pro.","Có thể chọn nhiều học sinh và tạo đơn nâng Pro mới khi cần."]:i?["Lớp học chỉ được tạo sau khi hệ thống xác nhận thanh toán.","Mã lớp sẵn sàng để mời học sinh tham gia.","Giao bài, theo dõi hạn nộp và tổng hợp kết quả trong cùng một nơi."]:["Lưu trữ từ vựng mở rộng",`AI tạo từ nhanh ${M.pro} lần/ngày`,"Lộ trình học có sẵn","Hỗ trợ ưu tiên","Toàn bộ bài học"],u=s==="error"&&!y;return t.jsxs("div",{className:n.pageWrapper,children:[t.jsx(R,{title:s==="error"?"Cần xác nhận thanh toán - Luyện Từ":"Thanh toán thành công - Luyện Từ",description:"Giao dịch đã hoàn tất và hệ thống đang cập nhật quyền lợi cho tài khoản.",path:"/payment-success",noindex:!0}),t.jsx("div",{className:n.bgGlow}),t.jsx("div",{className:n.confetti,children:[...Array(10)].map((x,c)=>t.jsx("div",{className:n.confettiPiece},c))}),t.jsxs("div",{className:n.card,children:[t.jsx("div",{className:n.iconWrapper,children:s==="error"?t.jsx(v,{className:n.checkIcon}):t.jsx(T,{className:n.checkIcon})}),t.jsx("h1",{className:n.title,children:u?"Thanh toán đã được ghi nhận":s==="error"?"Cần xác nhận lại thanh toán":a?"Đã kích hoạt Pro cho học sinh!":"Thanh toán thành công!"}),t.jsx("p",{className:n.subtitle,children:u?"Hệ thống chưa xác nhận được quyền Pro cho tài khoản của bạn.":a?"Giao dịch đã được ghi nhận. Hệ thống đang cập nhật quyền Pro cho học sinh đã chọn trong lớp.":i?"Giao dịch đã được ghi nhận. Lớp học sẽ được tạo tự động ngay khi hệ thống xác nhận xong.":"Cảm ơn bạn đã nâng cấp tài khoản Pro. Các tính năng nâng cao đã được kích hoạt."}),s==="processing"&&t.jsxs("div",{className:n.processingRow,children:[t.jsx(v,{className:n.spinIcon}),t.jsx("span",{className:n.processingText,children:a?"Đang kích hoạt Pro cho học sinh...":i?"Đang tạo lớp học...":"Đang cập nhật trạng thái gói..."})]}),s==="error"&&t.jsx("div",{className:n.processingRow,children:t.jsx("span",{className:n.processingText,children:u?"Vui lòng tải lại trang để thử xác nhận lần nữa. Nếu vẫn chưa có Pro, hãy liên hệ hỗ trợ và gửi mã đơn hàng.":"Chưa xác nhận được thanh toán. Vui lòng quay lại lớp học và thử lại sau ít phút."})}),!u&&t.jsxs("div",{className:n.benefitsCard,children:[t.jsxs("div",{className:n.benefitsTitle,children:[t.jsx("span",{children:"✓"})," ",a?"Pro học sinh đã chọn":i?"Lớp học của bạn":"Quyền lợi Pro của bạn"]}),t.jsx("div",{className:n.benefitsList,children:w.map((x,c)=>t.jsxs("div",{className:n.benefitItem,children:[t.jsx(T,{className:n.benefitCheck}),t.jsx("span",{children:x})]},c))})]}),t.jsxs("div",{className:n.buttonsRow,children:[t.jsxs("button",{className:n.primaryBtn,onClick:()=>
1{if(u){window.location.reload();return}o(a?`/classes/${f||""}`:i?`/classes/${m?.id||""}`:"/")},children:[u?t.jsx(v,{}):t.jsx(E,{})," ",u?"Thử xác nhận lại":a?"Về lớp học":i?"Mở lớp học":"Về trang chủ"]}),t.jsxs("button",{className:n.secondaryBtn,onClick:()=>o(y?"/classes":"/categories"),children:[t.jsx(L,{})," ",y?"Lớp của tôi":"Học ngay"]})]})]})]})}export{pt 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.