PageSourceSearch

https://myka.ng/assets/MandateSuccessPage-DENQGg9X.js

js myka.ng collected 2026-10-09 22:42:18 UTC 3,550 bytes, 1 lines download raw bytes

1import{p as K,r as f,j as a,N as Q}from"./vendor-react-DfYGAhtm.js";import{g as _,f as $}from"./vendor-state-BsBVN-fX.js";import{x as z,m as p,S}from"./index-DsBgCU7r.js";import{g as V,a as O,c as U}from"./paymentMandateReturnSession-B31Waw65.js";import{u as D,g as H}from"./walletApi-DyFgHNVA.js";import{v as G,W as I}from"./walletMandateApi-Du1GplC_.js";import{M as J}from"./MandateStatusView-8tg2FuDm.js";import{W as X}from"./walletMandateReturnUrls-BPu4z42g.js";import{r as Z,g as ee,a as te,c as ae}from"./walletMandateSession-B-c6J5GS.js";import{a as C,h as R,S as L,T as B}from"./vendor-ui-DA_r9yXk.js";import"./vendor-icons-1odZwi-b.js";import"./vendor-forms-BP-7CbAP.js";import"./failed-Dd90HJgP.js";import"./success-C0L8gZxS.js";import"./StepPageLayout-DdZUweau.js";const re=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)&&t>=0?t:void 0},ne=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},N=e=>e.invalidateQueries({queryKey:I,predicate:t=>t.queryKey[2]!=="verify-success"}),Se=()=>{const{navigate:e}=z(),t=_(),[n]=K(),c=Z(n.get("method")),i=c==="BANK",d=ee(n),b=n.get("account")?.trim()||void 0,T=n.get("cref")?.trim()||void 0,A=re(n.get("before")),j=ne(n.get("started")),[s]=f.useState(()=>te()),[v]=f.useState(()=>V()),m=v?O(v):null,{virtualAccount:w,isLoading:y}=D(),E=H(w)||void 0,u=b||s?.accountNumber||E||void 0,g=T||s?.createReference,l=A??s?.activeCountBefore,h=j??s?.startedAt,F=!!(b&&(d||typeof A=="number")),M=!s||s.paymentMethod===c||F,P=typeof l=="number"||typeof h=="number"||!!(d||g),r=$({queryKey:["wallets","mandates","verify-success",c,u,l,d,g,h],enabled:!!u&&M&&P&&!y,queryFn:async()=>u?G({accountNumber:u,paymentMethod:c,activeCountBefore:l,processorReference:d,createReference:g,startedAt:h}):!1,retry:!1,staleTime:1/0,gcTime:5*6e4,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1}),o=r.isSuccess&&r.data===!0,x=!M||!y&&(!u||!P)||r.isError||r.isSuccess&&r.data===!1;f.useEffect(()=>{(o||x)&&ae(),o&&N(t)},[x,o,t]),f.useEffect(()=>{!o||!m||(U(),e(m,{replace:!0}))},[o,e,m]);const Y=()=>{const k=i?S.LinkedBanks:S.LinkedCards,W=new URLSearchParams({refresh:"1"});typeof l=="number"&&W.set("before",String(l)),e(`/${k}?${W}`,{replace:!0})},q=()=>{N(t),e(`/${S.Wallet}`,{replace:!0})};if(!o&&(y||r.isLoading||r.isFetching))return a.jsx(C,{maxW:"600px",mx:"auto",px:4,py:16,children:a.jsxs(R,{gap:5,align:"center",children:[a.jsx(L,{size:"xl",color:p.orange[500],borderWidth:"3px"}),a.jsxs(B,{fontSize:"sm",color:p.text.gray,textAlign:"center",children:["Confirming your ",i?"bank":"card"," with Paystack…"]})]})});if(x){const k=new URLSearchParams({status:"cancelled",method:c,reason:"incomplete"});return a.jsx(Q,{to:`${X.cancel}?${k}`,replace:!0})}return m?a.jsx(C,{maxW:"600px",mx:"auto",px:4,py:16,children:a.jsxs(R,{gap:5,align:"center",children:[a.jsx(L,{size:"xl",color:p.orange[500],borderWidth:"3px"}),a.jsx(B,{fontSize:"sm",color:p.text.gray,textAlign:"center",children:"Payment method linked. Taking you back to your policy…"})]})}):a.jsx(J,{variant:"success",title:i?"Bank linked successfully":"Card linked successfully",description:i?"Your bank mandate is ready. You can use it to fund your wallet and pay premiums faster.":"Your card mandate is ready. You can use it to fund your wallet and pay premiums faster.",onGoHome:()=>e("/home",{replace:!0}),primaryAction:{label:i?"View linked banks":"View linked cards",onClick:Y},secondaryAction:{label:"Back to wallet",buttonType:"outline",onClick:q}})};export{Se 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.