PageSourceSearch

https://console.quidkey.com/assets/merchants._merchantId.connections-tD3RQsA7.js

js quidkey.com collected 2026-09-24 13:41:25 UTC 5,426 bytes, 1 lines download raw bytes

1import{r as l,j as e,aS as k,aT as b,aU as f,aV as C,aW as y,aX as N,B as o,c as T,b as D,K as E,k as F,U as p,au as x,N as P,dY as h}from"./main-To_L_1y0.js";import{u as S}from"./useMutation-B7FocJ-g.js";import{C as Q,a as z,b as A,d as R}from"./card-C3vrXP0B.js";import{C as M}from"./merchant-detail-utils-bX_jeLIZ.js";import{r as O,S as B,a as L,b as W,s as _,d as q,c as K,e as U}from"./stripe-connect-consent-DLwL3Q74.js";import{A as Y}from"./arrow-right-DyBKxEYb.js";import{C as v}from"./circle-alert-FW1OSRXz.js";import"./shield-check--JuXPhus.js";import"./eye-CK6rlTdb.js";import"./lock-CB2_CCHv.js";function H({open:t,onOpenChange:s,merchantId:r}){const[a,i]=l.useState("welcome");l.useEffect(()=>{if(!t){const c=setTimeout(()=>i("welcome"),200);return()=>clearTimeout(c)}},[t]);const n=S({mutationFn:()=>O(r),onSuccess:c=>{window.location.assign(c)}});return e.jsx(k,{open:t,onOpenChange:s,children:e.jsx(b,{className:"sm:max-w-md",children:a==="welcome"?e.jsxs(e.Fragment,{children:[e.jsxs(f,{children:[e.jsx(C,{children:"Connect your Stripe account"}),e.jsx(y,{children:B})]}),e.jsx(L,{}),e.jsxs(N,{children:[e.jsx(o,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsxs(o,{onClick:()=>i("permissions"),children:["Continue with Stripe",e.jsx(Y,{className:"h-4 w-4 ml-1.5"})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(f,{children:[e.jsx(C,{children:"What Quidkey can access"}),e.jsxs(y,{children:["You'll be sent to Stripe to approve a ",e.jsx("strong",{children:"read-only"})," connection."]})]}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(W,{}),n.isError&&e.jsxs("p",{className:"flex items-center gap-1.5 text-destructive",children:[e.jsx(v,{className:"h-4 w-4 shrink-0"}),n.error.message]})]}),e.jsxs(N,{children:[e.jsx(o,{variant:"outline",onClick:()=>i("welcome"),disabled:n.isPending,children:"Back"}),e.jsx(o,{onClick:()=>n.mutate(),disabled:n.isPending,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 mr-1.5 animate-spin"}),"Redirecting..."]}):"Continue to Stripe"})]})]})})})}function X({merchantId:t,returnStatus:s}){const{can:r}=D(),a=r("merchant-connections:manage"),i=E(),[n,c]=l.useState(!1),d=F(U(t)),u=d.data,m=u?.status,j=S({mutationFn:()=>q(t),onSuccess:async()=>{p.success("Stripe disconnected"),await i.invalidateQueries({queryKey:_.status(t)})},onError:w=>{p.error(w.message)}}),g=s!==void 0&&m!=="connected";return e.jsxs(Q,{children:[e.jsxs(z,{className:"flex flex-row items-center justify-between space-y-0",children:[e.jsx(A,{className:"text-base",children:"Stripe"}),m==="connected"?e.jsxs(x,{variant:"success",children:[e.jsx(P,{className:"h-3 w-3 mr-1"}),"Connected"]}):m?e.jsx(x,{variant:"secondary",children:"Not connected"}):null]}),e.jsx(R,{className:"space-y-4",children:d.isLoading?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading connection status..."}):d.isError?e.jsxs("p",{className:"text-sm text-destructive",children:["Couldn't load the Stripe connection: ",d.error.message]}):u?.status==="connected"?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Connected as: ",u.email??"unknown account",u.livemode===!1&&e.jsx(x,{variant:"outline",className:"ml-2",children:"test mode"})]}),e.jsx(K,{merchantId:t}),a&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"outline",size:"sm",onClick:()=>c(!0),children:"Reconnect"}),e.jsx(M,{title:"Disconnect Stripe?",description:"Quidkey will no longer be able to read your Stripe data, and the savings analysis will stop. You can reconnect at any time.",confirmLabel:"Disconnect",isPending:j.isPending,onConfirm:()=>j.mutateAsync(),children:e.jsx(o,{variant:"outline",size:"sm",children:"Disconnect"})})]})]}):e.jsxs(e.Fragment,{children:[g&&e.jsxs("p",{className:"flex items-start gap-1.5 text-sm text-destructive",children:[e.jsx(v,{className:"h-4 w-4 mt-0.5 shrink-0"}),s==="denied"?"The connection was cancelled on Stripe. Nothing was changed.":s==="already_connected"?"That Stripe account is already connected to another Quidkey merchant. Disconnect it there first, or connect a different Stripe account.":"The connection couldn't be completed. Nothing was changed."]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Accept c
1ard payments and sync payment data with Quidkey to see what you could save on currency conversion."}),a&&e.jsx(o,{size:"sm",onClick:()=>c(!0),children:g?s==="already_connected"?"Connect a different account":"Try again":"Connect Stripe"})]})}),e.jsx(H,{open:n,onOpenChange:c,merchantId:t})]})}function ie(){const{merchantId:t}=h.useParams(),{status:s}=h.useSearch(),r=h.useNavigate(),[a]=l.useState(s);return l.useEffect(()=>{s&&(s==="success"&&p.success("Stripe connected"),r({search:i=>({...i,status:void 0}),replace:!0}))},[s,r]),e.jsx(V,{merchantId:t,returnStatus:a==="success"?void 0:a})}function V({merchantId:t,returnStatus:s}){return e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[e.jsxs("div",{className:"shrink-0",children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Connections"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect your financial platforms to unlock automated reconciliation, payouts and FX savings."})]}),e.jsx("div",{className:"mt-6 max-w-2xl",children:e.jsx(X,{merchantId:t,returnStatus:s})})]})}export{V as MerchantConnectionsPage,ie as component};

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.