1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8686],{7043:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/learn/payment/success",function(){return n(72816)}])},72816:function(e,t,n){"use strict";n.r(t);var s=n(47568),r=n(97582),a=n(85893),c=n(67294),i=n(41664),o=n.n(i),l=n(11163),u=n(54404),d=n(38660),h=n(98795),x=n(83720),m=n(21292),p=function(){var e=(0,l.useRouter)(),t=e.query.purchaseId,n=(0,h.V)().refresh,i=(0,c.useState)("loading"),p=i[0],f=i[1],y=(0,c.useState)(null),b=y[0],g=y[1],w=(0,c.useState)(""),N=w[0],j=w[1];(0,c.useEffect)(function(){if(e.isReady&&t){var a,c=!1;return(a=(0,s.Z)(function(){var e,s,a,i,o;return(0,r.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,7,,8]),[4,new Promise(function(e){return setTimeout(e,3e3)})];case 1:return r.sent(),[4,null===(e=x.I8.currentUser)||void 0===e?void 0:e.getIdToken()];case 2:if(!(s=r.sent()))throw Error("Please sign in again to verify your purchase.");return[4,fetch("/api/learn/purchases/status?purchaseId=".concat(encodeURIComponent(t)),{headers:{Authorization:"Bearer ".concat(s)}})];case 3:return[4,(a=r.sent()).json().catch(function(){return{}})];case 4:if(i=r.sent(),!a.ok)throw Error(i.error||"Unable to verify purchase");if(c)return[2];if(g(i),f(i.hasPaid?"completed":"pending"),!i.hasPaid)return[3,6];return[4,n()];case 5:r.sent(),r.label=6;case 6:return[3,8];case 7:if(o=r.sent(),c)return[2];return j(o.message||"Unable to verify purchase"),f("error"),[3,8];case 8:return[2]}})}),function(){return a.apply(this,arguments)})(),function(){c=!0}}},[t,n,e.isReady]);var k=(0,m.U)({title:"Payment Successful | CNBC Academy",description:"Your CNBC Academy phase purchase is being confirmed.",path:"/user/learn/payment/success",robots:{noindex:!0,nofollow:!0}});return(0,a.jsxs)(u.Z,{title:"Payment successful",children:[(0,a.jsx)(d.Z,{seo:k}),(0,a.jsxs)("div",{className:"border border-gray-200 bg-white p-7",children:["loading"===p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-xs font-bold uppercase tracking-widest text-cnbc-gray-muted",children:"Confirming payment"}),(0,a.jsx)("h1",{className:"mt-1 text-2xl font-bold text-cnbc-navy",children:"Thanks â we are unlocking your phase"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-cnbc-gray-lighter",children:"This usually takes a few seconds while PayFast confirms the payment."})]}),"completed"===p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-xs font-bold uppercase tracking-widest text-cnbc-yellow",children:"Payment confirmed"}),(0,a.jsxs)("h1",{className:"mt-1 text-2xl font-bold text-cnbc-navy",children:[(null==b?void 0:b.phaseTitle)||"Your phase"," is now unlocked"]}),(0,a.jsx)("p",{className:"mt-2 text-sm text-cnbc-gray-lighter",children:"You can start learning immediately."}),(0,a.jsx)(o(),{href:"/user/learn",children:(0,a.jsx)("a",{className:"mt-5 inline-block bg-cnbc-navy px-5 py-3 text-xs font-bold uppercase tracking-widest text-white",children:"Go to CNBC Academy"})})]}),"pending"===p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-xs font-bold uppercase tracking-widest text-cnbc-gray-muted",children:"Payment pending"}),(0,a.jsx)("h1",{className:"mt-1 text-2xl font-bold text-cnbc-navy",children:"We have not confirmed your payment yet"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-cnbc-gray-lighter",children:"If you completed payment, refresh this page in a moment or return to CNBC Academy."}),(0,a.jsx)(o(),{href:"/user/learn",children:(0,a.jsx)("a",{className:"mt-5 inline-block bg-cnbc-navy px-5 py-3 text-xs font-bold uppercase tracking-widest text-white",children:"Back to CNBC Academy"})})]}),"error"===p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-xs font-bold uppercase tracking-widest text-red-600",children:"Verification issue"}),(0,a.jsx)("h1",{className:"mt-1 text-2xl font-bold text-cnbc-navy",children:"We could not verify your purchase"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-cnbc-gray-lighter",children:N}),(0,a.jsx)(o(),{href:"/user/learn",children:(0,a.jsx)("a",{className:"mt-5 inline-block bg-cnbc-navy px-5 py-3 text-xs font-bold uppercase tracking-widest text-white",children:"Back to CNBC A
1cademy"})})]})]})]})};t.default=p}},function(e){e.O(0,[4043,1664,1379,9111,5146,6237,2159,9774,2888,179],function(){return e(e.s=7043)}),_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.