PageSourceSearch

https://aavia.io/cdn/shopifycloud/checkout-web/assets/c1/component-lazyBankPaymentMethod.DRDx6Xmg.js

js aavia.io collected 2026-10-01 12:03:00 UTC 9,382 bytes, 1 lines download raw bytes

1import{u as a,A as W,q as A,U as q,V as K,k as g,e as G,h as D,T as E,S as H}from"./esnext-vendor.BDPAaZdq.js";import{b as R,a as U}from"./Choice.BIzIW4rp.js";import{F as z,o as _,B as Q,c9 as X,b9 as V,W as $,E as Y,c as L,l as j,S as J,I as Z}from"./hydrate.B0xlt2dG.js";import{O as P,aS as ee,Q as ne,ce as te,bh as F,bb as ae}from"./hooks-useReplaceShopPayInHistory.C8UL-mAH.js";import{P as oe}from"./components-PaymentMethodProgressionHost.BmXVNMRw.js";import{P as re}from"./PaymentIcon.CQXs-ePm.js";import{g as M,F as ce,D as se,M as ie}from"./PaymentLine.BkPc0Zsc.js";import{u as le,W as ue}from"./WalletsSandbox-WalletSandbox.Dp4t7VmS.js";import{u as de,a as me,S as pe}from"./hooks-useStableHostMethodsReferences.DLE4q0sj.js";import"./Checkbox.CiixBh9Z.js";import"./app.D1P6yWfp.js";import"./helpers-getNormalizedPaymentMethodName.B-mE5wnL.js";import"./shared-permissions.BaDWlj5_.js";import"./hooks-useShopPayExternalAppContext.DyGXtar4.js";import"./graphql-PaymentSessionMutation.BhOnX3QJ.js";import"./Section._KuAKpGQ.js";import"./ImpressionEventCapture.iMEQlBKs.js";import"./ChangeCompanyLocationLink.Ci5U9F_D.js";import"./BillingAddressForm.aTSlVDrG.js";import"./FormLayout.CMVyKzjL.js";import"./amazon-pay-useAmazonPayPaymentLine.BXwZMsYY.js";import"./PhoneField.ykPh8SPx.js";import"./hooks-useSuppressShopPayModalOnLoad.brztd70E.js";
1import"./Popover.BUTwaoOa.js";import"./AddressPresenter.B0qw2vWQ.js";import"./components-useVaultedMsiInstallments.Br5peiWP.js";import"./EmptyState.b83C9ddY.js";import"./localization-index.Bo8bPuxq.js";import"./helpers-credit-card-disabled.BnSr1GsQ.js";import"./hooks-useUpdateCheckoutAddress.xu8w67CI.js";import"./helpers-derivations.DLW2fhKL.js";import"./money-toShopPayMoneyInput.-nuohgDW.js";import"./redemption-promotions.CgqGtCd-.js";import"./shop-pay-normalizeBuyerDetails.ThnUnxcv.js";import"./checkout-updaters-helpers.BAeH3ddd.js";import"./helpers-setAddressErrors.BA8OjimY.js";import"./hooks-useShopPayProgressIntercepts.Sxhi7oHx.js";import"./MissingFields.DB7ri4eR.js";import"./components-RedirectionNotice.module.BGJWZ6-9.js";import"./useAddressMutationsWithNegotiation.BfzEjUy6.js";import"./Rollup.iQVJ47hC.js";import"./utilities-publishMessage.BORnEDuA.js";import"./utilities-stable-ref.Dvd2X3ul.js";import"./PayButton-helpers.Dg5kgVMm.js";import"./hooks-useGeneralPaymentErrorMessage.Zl8_48Ok.js";const ke="vr1Ob",ye={bankDigitsNoWrap:ke};function be({accountType:t,bankName:c,lastDigits:s,id:i}){const{i18n:l}=P(),r=()=>{const e=t?.toLowerCase();return e==="checking"?l.translate("payment.bank_account_type.checking"):e==="savings"?l.translate("payment.bank_account_type.savings"):""};return a(R,{id:i,value:i,children:[a(z,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",padding:"none",alignItems:"center",alignContent:"center",children:[a(re,{type:M(c)}),a(_,{type:"strong",children:[c," ",a("span",{className:ye.bankDigitsNoWrap,children:l.translate("payment.masked_digits_label",{last_digits:s})})]})]}),t&&a(Q,{padding:"small-400 none none none",children:a(_,{children:r()})})]},i)}const fe="STRIPE_BANK",he={id:"137c4da513561030856913c790967e4e298bea45ad3d6adfc786bc844ca55be2",type:"query",name:"StripeFinancialConnectionsClientSecret",source:""},ge=5,_e=async({graphql:t,observability:c})=>{const s=async e=>{const{data:o,error:m}=await t.staticQuery(he,{cache:!1,variables:{input:e?{pendingTask:{taskId:e}}:{}}});return m!=null?(r(m.message),null):o??(r("NO_DATA"),null)};let i=0,l="";do{const e=await s(l);if(e===null)return null;const{stripeFinancialConnectionsClientSecret:o}=e;switch(o.__typename){case"StripeFinancialConnectionsClientSecretCreationFailed":return r(o.errorCode),null;case"StripeFinancialConnectionsClientSecretCreationSuccess":return o.clientSecret;case"PendingTask":{if(l=o.taskId,i+=1,i>=ge)return r("REACHED_MAX_POLLING"),null;await K(o.pollDelay);break}default:q(o)}}while(!0);function r(e){return c.counter({name:"stripe_financial_connections_client_secret_error",value:1,attributes:{code:e}}),c.log("use_get_client_secret_stripe_client_secret_creation_failed","createStripeFinancialConnectionsClientSecret failed",{attributes:{code:e}}),null}},Se=()=>{const{observability:t,graphql:{coreGraphql:c}}=P(),s=W(null);return A(async()=>s.current?s.current:s.current=_e({graphql:c,observability:t}).finally(()=>{s.current=null}),[c,t])};function Ce({clientCredentials:t,observability:c,onBankAccountCollected:s}){const i=de(),l=le(),r=Se(),[e,o]=g(!0),m=X(),{i18n:y}=P(),n=G(null),[u,k]=g(!1),[h,S]=g(null),[p,f]=g(null);D(()=>{(async()=>f(await r()))()},[r]);const B=async d=>{n.value=d;const w=await d.call.configure(t?.apiClientKey??"",t?.merchantAccountId??"");w?.status!==pe.Success&&(c.leaveErrorBreadcrumb("Stripe Bank sandbox configuration failed",{status:w.status}),m(y.translate("payment.bank_account_generic_error"))),o(!1)},T=()=>{o(!1),k(!1)},x=d=>{c.leaveErrorBreadcrumb("bank_account_collected",{bankAccountId:d.id,bankName:d.bankName??"",type:d.type}),S(d),s(d),T()},N=d=>{c.leaveErrorBreadcrumb("Bank account token collection failed",{error:d}),m(y.translate("payment.bank_account_generic_error")),T()},b=async()=>{if(n.value){o(!p);const d=p||await r();k(!0),d?(n.value.call.collectBankAccount(d),p&&f(null)):(o(!1),k(!1),N("No client secret")),o(!1)}},C=me({breadcrumb:i,onBankAccountCollected:x,onModalClosed:T,onError:N,telemetry:l}),v=()=>{n.value=null};return{connectedBankAccount:h,handleBankConnectionClick:b,terminateSandbox:v,isLoading:e,Sandbox:a(V,{children:a(ue,{wallet:fe,onConnect:B,hostMethods:C,isSdkOnly:!u,isFullScreen:u,onTerminate:v})})}}function Be(t,c,s,i){const{bankPaymentTokenSignal:l}=ee(),[r,e]=g(t[0]??null),o=A(n=>{if(!n){c(s,{type:"bank",selectedToken:void 0,selectedType:void 0});return}c(s,{type:"bank",selectedToken:n.id,selectedType:n.type}),i(n.bankName??"")},[s,c,i]),m=A(n=>{e(n),n?l.value={selectedToken:n.id,selectedType:n.type}:l.value=void 0,o(n),n&&i(n.bankName??"")},[e,o,i]),y=ne().paymentLines.value;return D(()=>{const n=y.find(u=>u.method.type==="bank")?.method;if(n){if(n.selectedToken&&n.selectedType){const u=t.find(k=>k.id===n.selectedToken);u?(e(u),i(u.bankName??"")):(l.value=void 0,o(null))}else if(r){if(!t.some(u=>u.id===r.id))return;l.value={selectedToken:r.id,selectedType:r.type},o(r)}}},[t,o,y,r,i]),{selectedBankAccount:r,setSelectedBankAccount:m}}
1class Te extends Error{constructor(){super(...arguments),this.name="BankPaymentTokenInterceptError"}}function ve(t){return{bankName:t.bankName??"",lastDigits:t.lastDigits??"",id:t.shopifyPublicToken??"",accountType:t.accountType??"savings",type:"SHOPIFY_PUBLIC_TOKEN"}}function O({method:t,setSelected:c,id:s,setIcon:i}){const{paymentProviderClientCredentials:l,availableInstruments:r}=t,{i18n:e,shop:o,observability:m}=P(),[y,n]=g(),{connectedBankAccount:u,handleBankConnectionClick:k,isLoading:h,Sandbox:S}=Ce({clientCredentials:l,observability:m,onBankAccountCollected:b=>{B(b??null),n(void 0)}});te(async({parts:b,reason:C})=>{const I=b.paymentLines.value.find(d=>d.method.type==="bank");if((C==="completion"||C==="progression")&&I){if(!f)return{behavior:"block",reason:F.MissingBankAccount,perform(){n(e.translate("payment.bank_account_missing"))}};if(!I.method.selectedToken)return m.error(new Te("Bank payment blocked at completion: selectedBankAccount is set but selectedToken is missing from payment line")),{behavior:"block",reason:F.MissingBankAccount,perform(){n(e.translate("payment.bank_account_missing"))}}}return{behavior:"allow"}});const p=E(()=>[...r.map(ve),...u?[u]:[]],[r,u]),{selectedBankAccount:f,setSelectedBankAccount:B}=Be(p,c,s,i),T=A(([b])=>{const C=p.find(v=>v.id===b);B(C??null)},[p,B]),x=E(()=>[f?.id??""],[f?.id]),N=!!u;return a(L,{gap:"base",children:[S,y&&a($,{tone:"critical",errorType:Y.PaymentError,children:y}),p.length>0?a(H,{children:[a(L,{gap:"small-100",padding:"none none small-100 none",children:[N?a(_,{color:"subdued",children:e.translate("payment.new_bank_account_disclaimer",{shop_name:o?.name||""})}):null,a(_,{color:"subdued",children:e.translate("payment.bank_account_disclaimer")})]}),a(U,{values:x,onChange:T,variant:"grid",children:p.map(b=>a(be,{...b},b.id))})]}):a(_,{children:e.translate("payment.bank_account_choose")}),a(j,{variant:"plain",textDecoration:"none",disabled:h,onClick:k,tone:h?"monochrome":"auto",children:a(L,{direction:"inline",alignItems:"center",gap:"small-100",minBlockSize:"10px",minInlineSize:"10px",children:[h?a(J,{size:"base"}):a(Z,{type:"plus"}),a(_,{color:"subdued",children:p.length>0?e.translate("payment.bank_account_connect_another"):e.translate("payment.bank_account_connect")})]})})]})}function hn({method:t,setSelected:c,id:s,showSelectedContent:i=!0,bare:l=!1}){const{i18n:r}=P(),e=t.availableInstruments[0]?.bankName,o=e?[M(e)]:se,[m,y]=g(o),[n,u]=g(e?void 0:ie),k=t.displayName??r.translate("payment.bank_payment_method_label"),h=A(f=>{y([f?M(f):ce]),u(void 0)},[]);if(l)return a(O,{id:s,method:t,setIcon:h,setSelected:c});const S=ae(r,m,n),p=S?`${k}, ${S}`:k;return a(R,{renderSelectedContentWhenCollapsed:!0,secondaryContent:a(oe,{paymentBrands:m,brandCountOverride:n}),value:s,accessibilityLabel:p,selectedContent:i?a(O,{id:s,method:t,setIcon:h,setSelected:c}):void 0,children:a(_,{type:"strong",children:k})})}export{hn as BankPaymentMethod,O as BankPaymentMethodDetails};

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.