import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{e as r,C as o}from"./p-DaIKrQry.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as s,a as e}from"./p-Cb8cfh-k.js";const a=({id:a,authToken:i,service:t})=>async({onSuccess:p,onError:c,final:n})=>{var m;try{const n=await t.fetchPayment(a,i);if(n.error){c({error:e(n.error),code:s(null===(m=n.error)||void 0===m?void 0:m.code),severity:o.ERROR})}else p({payment:new r(n.data)})}catch(r){const a=s(null==r?void 0:r.code);c({error:e(r),code:a,severity:o.ERROR})}finally{n()}};export{a as m}