import{d as P,j as C,o as l,h as m,e as t,g as d,a as n,I as W,t as h,m as ne,F as E,p as q,q as I,y as oe,s as g,v as se,n as re,k as A,l as L,A as ae,B as J,C as Q,Y as j,V as ie,c as T,D as X,E as U,G as le,b as Z,H as de,J as N,f as p,K as B,r as ue,$ as ce,L as pe,M as me,T as ye,N as ve,O as fe,P as _e,w as M,x as ee,Q as be,R as he,S as ge,U as Pe,W as ke,u as $e,i as we}from"./D5UygZbA.js";import{_ as Se}from"./CwEGjsqF.js";import{j as Te,k as Oe,l as Be,m as Ce,n as xe,o as Me}from"./BTOuAH5P.js";import{u as qe}from"./CTyrGZol.js";import{u as Ae}from"./BiBQQ1Sh.js";import"./1l06Ixkb.js";const Le={class:"de--pos-trx-details"},Ue={key:1},Ie={key:2},te=P({__name:"PayOrderByPOSTransactionDetails",props:{code:{},provider:{},transaction:{}},setup(y){const u=y,a=C(()=>u.provider.type==="inquiry_code"?"Inquiry Code":"Reference Number");return(s,o)=>(l(),m("div",Le,[t("table",null,[t("tbody",null,[t("tr",null,[o[0]||(o[0]=t("th",null,"ID",-1)),t("td",null,[d(n(W),{value:s.transaction.id,truncate:"","max-width":"110"},null,8,["value"])])]),t("tr",null,[t("th",null,h(n(a)),1),t("td",null,[d(n(W),{value:s.code,truncate:"","max-width":"110"},null,8,["value"])])]),t("tr",null,[o[1]||(o[1]=t("th",null,"Amount",-1)),t("td",null,h(n(ne)(s.transaction.amount,s.transaction.currency_code)),1)]),s.transaction.payer?(l(),m(E,{key:0},[t("tr",null,[o[2]||(o[2]=t("th",null,"Customer",-1)),t("td",null,h(s.transaction.payer.name),1)]),t("tr",null,[o[3]||(o[3]=t("th",null,"Phonenumber",-1)),t("td",null,h(s.transaction.payer.phone_number),1)])],64)):q("",!0),t("tr",null,[o[4]||(o[4]=t("th",null,"Issued at",-1)),t("td",null,h(n(I)(s.transaction.created_at)),1)]),s.transaction.paid_at?(l(),m("tr",Ue,[o[5]||(o[5]=t("th",null,"Paid at",-1)),t("td",null,h(n(I)(s.transaction.paid_at)),1)])):(l(),m("tr",Ie,[o[6]||(o[6]=t("th",null,"Expires at",-1)),t("td",null,h(n(I)(s.transaction.expires_at)),1)])),t("tr",null,[o[7]||(o[7]=t("th",null,"Status",-1)),t("td",null,[d(n(oe),{class:"!text-xs",content:s.transaction.status,color:s.transaction.status==="PAID"?"success":void 0},null,8,["content","color"])])])])])]))}}),Ee={class:"de--pos-bill"},Ne={class:"de--pos-bill-paper"},Re={class:"de--pos-bill-movable"},De=P({__name:"PayOrderByPOSBill",props:{details:{}},setup(y){const u=y,a=g(),s=g();return se([()=>{var o;return(o=u.details)==null?void 0:o.transaction},()=>a.value,()=>s.value],([o,e,r])=>{if(o&&e&&r){const{height:i}=r.getBoundingClientRect();e.style.height=`${ae(i)}px`}else!o&&e&&(e.style.height="")},{deep:!0,immediate:!0}),(o,e)=>{var r,i;return l(),m("div",Ee,[e[1]||(e[1]=t("div",{class:"de--pos-bill-line"},null,-1)),t("div",Ne,[e[0]||(e[0]=t("div",{class:"de--pos-bill-grove"},null,-1)),t("div",Re,[t("div",{ref_key:"wrapperRef",ref:a,class:re(["de--pos-bill-wrapper",{"de--pos-bill-wrapper-animated":(r=o.details)==null?void 0:r.transaction}])},[(i=o.details)!=null&&i.transaction?(l(),m("div",{key:0,ref_key:"contentRef",ref:s,class:"de--pos-bill-content"},[d(te,A(L(o.details)),null,16)],512)):q("",!0)],2)])])])}}}),He=P({__name:"PayOrderByPOSInquiry",props:{provider:{},loading:{type:Boolean},errorMessage:{}},emits:["error","success","update:loading"],setup(y,{emit:u}){const a=u,{$http:s}=J(),o=Z(),e=Q("PAYMENT"),r=y,i=C(()=>[{key:"code",label:"Reference Number",show:r.provider.type==="reference_number",component:j,rules:"required|numeric"},{key:"code",label:"Inquiry Code",show:r.provider.type==="inquiry_code",component:j,rules:"required|numeric"}]),f=g({}),S=C(()=>({captcha:o.public.isProduction?{apiKey:o.public.google.captchaKey,actionName:"developer_offline_order_test_pay"}:void 0,fields:i.value,divider:!1,submitAction:{button:{text:"Pay"}},request:c=>s({method:"GET",url:"/offline-order/test-pay",baseURL:e.value,params:{...c.data,payment_method_name:r.provider.name,includes:{transaction:["payer"]}},metadata:{silent:!0}}),onBeforeSubmit:()=>{a("error",void 0)},onSuccess:({data:c})=>{a("update:loading",!1),a("success",c.transaction)},onError:c=>{var $,x,O;const b=($=c==null?void 0:c.response)==null?void 0:$.status;b===404?a("error","The transaction you are searching for was not found. Please ensure that you have entered the correct reference number or inquiry code."):b===400&&a("error",(O=(x=c==null?void 0:c.response)==null?void 0:x.data)==null?void 0:O.message)}})),k=ie({value:()=>r.loading,formatter:c=>!!c,onUpdate:c=>a("update:loading",c)});return(c,b)=>(l(),T(n(le),X({loading:n(k),"onUpdate:loading":b[0]||(b[0]=$=>U(k)?k.value=$:null),modelValue:n(f),"onUpdate:modelValue":b[1]||(b[1]=$=>U(f)?f.value=$:null)},n(S)),null,16,["loading","modelValue"]))}}),ze={class:"de--pos-provider"},Ve={class:"de--pos-provider-title"},Ge={class:"de--pos-provider-icon"},Fe=P({__name:"PayOrderByPOSProvider",props:{provider:{},loading:{type:Boolean}},emits:["back"],setup(y,{emit:u}){const a=u;return(s,o)=>(l(),m("div",ze,[t("div",Ve,[d(n(N),{circle:"",size:"xs",icon:n(de),disabled:s.loading,onClick:o[0]||(o[0]=e=>a("back"))},null,8,["icon","disabled"]),t("div",null,[o[1]||(o[1]=p(" Complete payment with ")),t("b",null,h(s.provider.title),1)])]),t("div",Ge,[d(n(B),A(L({...s.provider.button.icon,...s.provider.details.icon})),null,16)])]))}}),Ye={class:"de--pos-providers"},Ke=P({__name:"PayOrderByPOSProviders",emits:["select"],setup(y,{emit:u}){const a=u,s=[{title:"Damen",name:"damen",type:"reference_number",button:{icon:{width:110,size:void 0,icon:ce}},details:{icon:{width:140}}},{title:"Fawry",name:"fawry",type:"reference_number",button:{icon:{width:110,size:void 0,icon:pe}},details:{icon:{width:140}}},{title:"OPay",name:"opay",type:"reference_number",button:{icon:{width:110,size:void 0,icon:me}},details:{icon:{width:140}}},{title:"Basata",name:"basata",type:"inquiry_code",button:{icon:{height:50,size:void 0,icon:ye}},details:{icon:{height:100}}},{title:"Maxab",name:"maxab",type:"inquiry_code",button:{icon:{height:50,size:void 0,icon:ve}},details:{icon:{height:70}}},{title:"Sadad",name:"sadad",type:"inquiry_code",button:{icon:{height:50,size:void 0,icon:fe}},details:{icon:{height:60}}}],o=e=>a("select",e);return(e,r)=>(l(),m("div",Ye,[(l(),m(E,null,ue(s,i=>d(n(N),X({key:i.name,height:"60","full-width":"",center:"",ref_for:!0},i.button,{onClick:f=>o(i)}),null,16,["onClick"])),64))]))}}),We={class:"de--pos-trx"},je=P({__name:"PayOrderByPOSTransaction",props:{code:{},provider:{},transaction:{}},emits:["cancel","success","error","loading"],setup(y,{emit:u}){const a=u,{$http:s}=J(),o=Q("PAYMENT"),e=y,r=C(()=>({keepSuccessLoading:!0,disableOthersWhileLoading:!0,items:[{button:{center:!0,fullWidth:!0,text:"Confirm",color:"secondary"},request:()=>s({method:"POST",url:"/offline-order/test-pay",baseURL:o.value,data:{code:e.code,payment_method_name:e.transaction.payment_method_name}}),onBeforeSubmit:()=>{a("loading",!0),a("error",void 0)},onSuccess:()=>{a("loading",!1),a("success")},onError:i=>{var f,S,k;((f=i==null?void 0:i.response)==null?void 0:f.status)===400&&a("error",(k=(S=i==null?void 0:i.response)==null?void 0:S.data)==null?void 0:k.message)},onFinally:()=>a("loading",!1)},{button:{center:!0,fullWidth:!0,text:"Cancel",color:"gray",on:{click:()=>a("cancel")}}}]}));return(i,f)=>(l(),m("div",We,[d(te,A(L(i.$props)),null,16),d(n(_e),A(L(n(r))),null,16)]))}}),Je={class:"de--pos-body"},Qe={class:"de--pos-body-alert"},Xe={key:2,class:"de--pos-body-success"},Ze=P({__name:"PayOrderByPOSBody",emits:["update-details"],setup(y,{emit:u}){const a=u,s=g(!1),o=g(!1),e=g(),r=g(),i=g(),f=C(()=>{var v,_,w,R,D,H,z,V,G,F,Y,K;if(((v=r.value)==null?void 0:v.payment_method_name)==="damen")return(_=r.value)==null?void 0:_.payment_source.damen.reference_number;if(((w=r.value)==null?void 0:w.payment_method_name)==="fawry")return(R=r.value)==null?void 0:R.payment_source.fawry.reference_number;if(((D=r.value)==null?void 0:D.payment_method_name)==="opay")return(H=r.value)==null?void 0:H.payment_source.opay.reference_number;if(((z=r.value)==null?void 0:z.payment_method_name)==="basata")return(V=r.value)==null?void 0:V.payment_source.basata.inquiry_code;if(((G=r.value)==null?void 0:G.payment_method_name)==="maxab")return(F=r.value)==null?void 0:F.payment_source.maxab.inquiry_code;if(((Y=r.value)==null?void 0:Y.payment_method_name)==="sadad")return(K=r.value)==null?void 0:K.payment_source.sadad.inquiry_code}),S=v=>i.value=v,k=v=>r.value=v,c=()=>{if(i.value&&r.value){const v={code:f.value,provider:i.value,transaction:{...r.value,status:"PAID",paid_at:he(new Date,"UTC","yyyy-MM-dd HH:mm:ss")}};a("update-details",v)}s.value=!0},b=()=>{s.value=!1,r.value=void 0,e.value=void 0,a("update-details",void 0)},$=()=>{e.value=void 0,r.value=void 0},x=()=>{e.value=void 0,r.value?r.value=void 0:i.value=void 0},O=v=>{e.value=v};return(v,_)=>(l(),m("div",Je,[n(i)?(l(),m(E,{key:0},[n(s)?q("",!0):(l(),T(Fe,{key:0,loading:n(o),provider:n(i),onBack:x},null,8,["loading","provider"])),n(e)?(l(),T(n(ee),{key:1,color:"error"},{default:M(()=>[t("div",Qe,h(n(e)),1)]),_:1})):q("",!0),n(s)?(l(),m("div",Xe,[d(n(B),{icon:n(be),size:"180"},null,8,["icon"]),_[3]||(_[3]=t("div",{class:"de--pos-body-success-text"},"Approved",-1)),d(n(N),{class:"de--pos-body-success-action",text:"Pay another order",color:"gray",onClick:b})])):n(r)?(l(),T(je,{key:3,code:n(f),provider:n(i),transaction:n(r),onError:O,onSuccess:c,onCancel:$,onLoading:_[0]||(_[0]=w=>o.value=w)},null,8,["code","provider","transaction"])):(l(),T(He,{key:4,loading:n(o),"onUpdate:loading":_[1]||(_[1]=w=>U(o)?o.value=w:null),"error-message":n(e),"onUpdate:errorMessage":_[2]||(_[2]=w=>U(e)?e.value=w:null),provider:n(i),onError:O,onSuccess:k},null,8,["loading","error-message","provider"]))],64)):(l(),T(Ke,{key:1,onSelect:S}))]))}}),et={class:"de--pos"},tt={class:"de--pos-header"},nt={class:"de--pos-header-roll"},ot={class:"de--pos-screen"},st={class:"de--pos-screen-content"},rt={class:"de--pos-screen-content-header"},at=P({__name:"PayOrderByPOS",setup(y){const u=g(),a=s=>u.value=s;return(s,o)=>(l(),m("div",et,[t("div",tt,[t("div",nt,[d(n(B),{icon:n(ge),width:"35%"},null,8,["icon"])])]),d(De,{details:n(u)},null,8,["details"]),t("div",ot,[t("div",st,[t("div",rt,[d(n(B),{icon:n(Pe),class:"de--pos-screen-battery",height:"22"},null,8,["icon"]),d(n(B),{icon:n(ke),height:"18"},null,8,["icon"])]),d(Ze,{onUpdateDetails:a})])])]))}}),it=["innerHTML"],lt=["innerHTML"],dt=["innerHTML"],ut=["innerHTML"],ct=["innerHTML"],pt=["innerHTML"],mt=["href"],yt=["href"],vt={class:"text-gray-800"},ft=["href"],_t=["href"],bt={class:"flex items-center justify-center w-full pt-12"},ht="Payiano | Test Pay Order by Reference Number",gt=`
  Test pay order by Reference Number or by Inquiry Code at POS
  terminals. Simulate the real world experience of completing a
  payment at various offline locations, convenience stores, post
  offices, or ATMs.
`,Ot=P({__name:"index",setup(y){const{sandboxPortalUrl:u,productionPortalUrl:a}=qe("INDIVIDUAL");$e({title:ht,description:gt,keywords:["Payiano test pay order","Payiano pay order API","Get paid by reference number","Get paid by inquiry code","Complete payment order","Damen reference number","Fawry reference number","OPay reference number","Basata reference number","Maxab reference number","Sadad reference number","Offline payment collection","Get paid through POS API","Complete payment with POS terminal"]});const s=Z();return Ae({breadcrumbs:[{name:"Documentation",url:s.public.siteUrl},{name:"Get Started",url:`${s.public.siteUrl}/api/rest/get-started`},{name:"Test Pay order",url:`${s.public.siteUrl}/api/rest/reference/test-pay-order`}]}),(o,e)=>{const r=we("router-link");return l(),m("div",null,[d(n(Se),null,{default:M(()=>[e[15]||(e[15]=t("h1",null,"Test Pay order by Reference Number or Inquiry Code",-1)),t("p",null,[e[0]||(e[0]=p(" You can test pay order by Reference Number or by Inquiry Code at POS terminals. This flow simulates the real world experience of completing a payment at various offline locations, convenience stores, post offices, or ATMs that support services like ")),t("span",{innerHTML:n(Te)()},null,8,it),e[1]||(e[1]=p(", ")),t("span",{innerHTML:n(Oe)()},null,8,lt),e[2]||(e[2]=p(", ")),t("span",{innerHTML:n(Be)()},null,8,dt),e[3]||(e[3]=p(", ")),t("span",{innerHTML:n(Ce)()},null,8,ut),e[4]||(e[4]=p(", ")),t("span",{innerHTML:n(xe)()},null,8,ct),e[5]||(e[5]=p(" or ")),t("span",{innerHTML:n(Me)()},null,8,pt),e[6]||(e[6]=p(". "))]),t("p",null,[e[8]||(e[8]=p(" This test flow marks payments as paid in the ")),t("a",{href:n(u),target:"_blank"},"sandbox",8,mt),e[9]||(e[9]=p(" environment, making it easier to test the whole process. It lets you check everything from the moment a ")),d(r,{to:"/api/rest/v1/company/online-payments/payment-links/create"},{default:M(()=>e[7]||(e[7]=[p("Payment Link")])),_:1}),e[10]||(e[10]=p(" is created to when the payment is finally settled. this flow allows you to thoroughly test each component of the transaction process, ensuring its effectiveness and reliability before going to ")),t("a",{href:n(a),target:"_blank"},"production",8,yt),e[11]||(e[11]=p(". "))]),d(n(ee),{color:"info",class:"!border-2"},{default:M(()=>[t("div",vt,[e[12]||(e[12]=p(" Please note that this testing process is only for the ")),t("a",{href:n(u),target:"_blank"},"sandbox",8,ft),e[13]||(e[13]=p(" environment and not for real transactions. To try out a real payment, you need to go to a store that accepts payments for our land-based providers. This way, you can see how it works in ")),t("a",{href:n(a),target:"_blank"},"production",8,_t),e[14]||(e[14]=p(" or in a real setting. "))])]),_:1})]),_:1}),t("div",bt,[d(n(at))])])}}});export{Ot as default};
