1"use strict";(self.webpackChunkcasso_link_docs=self.webpackChunkcasso_link_docs||[]).push([["4616"],{30723:function(e,t,n){n.r(t),n.d(t,{default:()=>h,frontMatter:()=>o,metadata:()=>a,assets:()=>c,toc:()=>d,contentTitle:()=>l});var a=JSON.parse('{"type":"mdx","permalink":"/new-demo/payout","source":"@site/src/pages/new-demo/payout.mdx","title":"Cas Link Demo - Payout","frontMatter":{"id":"payout-demo","title":"Cas Link Demo - Payout"},"unlisted":false}'),s=n("85893"),r=n("50065"),i=n("20588");let o={id:"payout-demo",title:"Cas Link Demo - Payout"},l=void 0,c={},d=[];function u(e){return(0,s.jsx)(i.Z,{})}function h(e={}){let{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},1438:function(e,t,n){n.d(t,{Z:function(){return l}});var a,s,r,i=n(67294);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let l=e=>{let{title:t,titleId:n,...l}=e;return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24","aria-labelledby":n},l),t?i.createElement("title",{id:n},t):null,a||(a=i.createElement("path",{fill:"#D9D9D9",d:"M2 11.397a1.5 1.5 0 0 1 1.5-1.5h17a1.5 1.5 0 0 1 1.5 1.5v8.579a1.5 1.5 0 0 1-1.5 1.5h-17a1.5 1.5 0 0 1-1.5-1.5z"})),s||(s=i.createElement("path",{fill:"#000",d:"M3.781 12.991c0-.328.399-.594.89-.594h2.673c.491 0 .89.266.89.594v.594c0 .328-.399.594-.89.594H4.672c-.492 0-.89-.266-.89-.594zM3.781 17.74a.89.89 0 0 1 .89-.89h1.782a.89.89 0 0 1 0 1.781H4.672a.89.89 0 0 1-.89-.89M3.781 19.968c0-.247.2-.446.445-.446h6.235a.445.445 0 1 1 0 .89H4.226a.445.445 0 0 1-.445-.444M8.469 17.598c0-.55.422-.997.943-.997h1.886c.521 0 .944.446.944.997s-.423.997-.944.997H9.413c-.521 0-.943-.446-.943-.997M13.578 17.74a.89.89 0 0 1 .89-.89h5.344a.89.89 0 0 1 0 1.781h-5.344a.89.89 0 0 1-.89-.89M13.858 5.438a5.59 5.59 0 0 1 3.57 7.442 5.6 5.6 0 0 1-1.285 1.913.98.98 0 0 1-1.365-1.404 3.628 3.628 0 1 0-5.49-4.7.98.98 0 0 1-1.598-1.133 5.59 5.59 0 0 1 6.168-2.118"})),r||(r=i.createElement("path",{fill:"#000",d:"M17.806 13.201a1.024 1.024 0 0 1 .346 2.019l-2.855.489a1.024 1.024 0 0 1-1.182-.837l-.489-2.855a1.024 1.024 0 0 1 2.019-.345l.316 1.845z"})))}},98012:function(e,t,n){n.d(t,{Z:function(){return o}});var a,s,r=n(67294);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let o=e=>{let{title:t,titleId:n,...o}=e;return r.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24","aria-labelledby":n},o),t?r.createElement("title",{id:n},t):null,a||(a=r.createElement("ellipse",{cx:13,cy:12.5,fill:"#D9D9D9",rx:8,ry:7.5})),s||(s=r.createElement("path",{fill:"#000",d:"M7.422 20.5v-1.635q-1.335-.108-2.184-.58-.83-.473-1.3-1.109a4.5 4.5 0 0 1-.667-1.235 7 7 0 0 1-.235-1.017L3 14.506h2.076l.036.345q.054.327.253.8.216.472.704.89.488.4 1.353.544v-4.413l-.09-.018a10.3 10.3 0 0 1-2.003-.672 3.7 3.7 0 0 1-1.426-1.144q-.525-.746-.524-1.907 0-1.144.56-1.962a3.94 3.94 0 0 1 1.48-1.29 5.6 5.6 0 0 1 2.003-.58V3.5h1.426v1.635q1.155.144 1.896.58t1.155 1q.434.562.632 1.108.198.525.252.89l.055.345H10.78l-.054-.273a2.3 2.3 0 0 0-.217-.654 2.3 2.3 0 0 0-.578-.726q-.396-.345-1.083-.527v4.16l.163.036q.685.163 1.39.4.704.236 1.281.653.595.4.957 1.072.36.654.361 1.689 0 1.071-.541 1.925a4.1 4.1 0 0 1-1.463 1.399q-.937.526-2.148.653V20.5zM5.401 8.876q0 .708.487 1.144.487.418 1.534.69V6.825q-.938.146-1.48.726a1.85 1.85 0 0 0-.541 1.326m5.56 6.03q0-.836-.56-1.253-.559-.419-1.553-.672v4.105q.921-.165 1.517-.745.595-.582.595-1.435"})))}},50502:function(e,t,n){n.d(t,{Z:function(){return o}});var a,s,r=n(67294);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let o=e=>{let{title:t,titleId:n,...o}=e;return r.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24","aria-labelledby":n},o),t?r.createElement("title",{id:n},t):null,a||(a=r.createElement("path",{fill:"#C9C9C9",d:"M10.735 10.534a1.767 1.767 0 0 1 2.53 0l8.207 8.356c1.128 1.147.33 3.11-1.265 3.11H3.793C2.2 22 1.4 20.037 2.528 18.89z"})),s||(s=r.createElement("path",{fill:"#000",fillRule:"evenodd",d:"M12 4a5 5 0 1 0 0 10 5 5 0 0 0 0-10M5 9a7 7 0 1 1 14 0A7 7 0 0 1 5 9",clipRule:"evenodd"})))}},32298:function(e,t,n){n.d(t,{Z:function(){return o}});var a,s,r=n(67294);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let o=e=>{let{title:t,titleId:n,...o}=e;return r.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24","aria-labelledby":n},o),t?r.createElement("title",{id:n},t):null,a||(a=r.createElement("path",{fill:"#C9C9C9",d:"M9.534 11.24c-.712.42-.712 1.1 0 1.52l8.356 4.923c1.147.677 3.11.198 3.11-.759V7.076c0-.957-1.963-1.436-3.11-.76z"})),s||(s=r.createElement("path",{fill:"#000",fillRule:"evenodd",d:"M3 12c0-.7.37-1.333.968-1.77l9.052-6.608c.929-.679 2.127-.749 3.066-.465C17.002 3.434 18 4.178 18 5.391V18.61c0 1.213-.998 1.957-1.915 2.234-.938.284-2.136.213-3.065-.465L3.968 13.77C3.37 13.333 3 12.7 3 12m2 0c0 .038.016.143.189.269l9.052 6.609c.314.23.8.292 1.236.16.458-.139.523-.358.523-.43V5.392c0-.071-.065-.29-.523-.429-.435-.132-.922-.07-1.236.16l-9.052 6.61c-.173.126-.189.23-.189.268",clipRule:"evenodd"})))}},24031:function(e,t,n){n.d(t,{Z:function(){return o}});var a,s,r=n(67294);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let o=e=>{let{title:t,titleId:n,...o}=e;return r.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24","aria-labelledby":n},o),t?r.createElement("title",{id:n},t):null,a||(a=r.createElement("path",{fill:"#D9D9D9",d:"M5.53 3.098C5.53 2.492 6.02 2 6.626 2h14.275C21.508 2 22 2.492 22 3.098v14.274c0 .607-.492 1.099-1.098 1.099H6.627a1.1 1.1 0 0 1-1.098-1.099z"})),s||(s=r.createElement("path",{fill:"#000",fillRule:"evenodd",d:"M2 6.149c0-1.642 1.405-2.973 3.137-2.973h2.147a.99.99 0 1 1 0 1.981H5.137c-.577 0-1.045.444-1.045.992v12.879c0 .547.468.99 1.045.99h5.284a.99.99 0 0 1 0 1.981H5.137C3.405 22.001 2 20.67 2 19.029zM20.824 6.149c0-1.642-1.23-2.973-2.746-2.973h-1.754a.99.99 0 0 0 0 1.981h1.754c.506 0 .916.444.916.992v12.879c0 .547-.41.99-.916.99h-4.5a.99.99 0 0 0 0 1.981h4.5c1.517.001 2.746-1.33 2.746-2.971z",clipRule:"evenodd"})))}},41205:function(e,t,n){n.d(t,{Z:function(){return o}});var a,s,r=n(67294);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let o=e=>{let{title:t,titleId:n,...o}=e;return r.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24","aria-labelledby":n},o),t?r.createElement("title",{id:n},t):null,a||(a=r.createElement("circle",{cx:13.765,cy:11.318,r:8.235,fill:"#D9D9D9"})),s||(s=r.createElement("path",{fill:"#000",d:"M5.256 12.861q-1.053 0-1.788-.433a3.04 3.04 0 0 1-1.092-1.167A3.2 3.2 0 0 1 2 9.736q0-.81.376-1.524.376-.716 1.092-1.148.735-.453 1.788-.452 1.035 0 1.751.452.734.431 1.092 1.148.375.716.376 1.524 0 .81-.376 1.525a2.86 2.86 0 0 1-1.092 1.167q-.715.433-1.75.433m-1.11 7.868L12.108 6.8h2.466L6.612 20.73zm1.092-9.675q.583 0 .903-.395.339-.396.339-.904 0-.527-.339-.922-.32
1-.395-.903-.395-.603 0-.923.395-.32.394-.32.922 0 .509.32.904t.923.395m8.244 9.864q-1.053 0-1.788-.433a3.04 3.04 0 0 1-1.092-1.167 3.26 3.26 0 0 1-.376-1.544q0-.81.376-1.506.377-.716 1.092-1.148.735-.452 1.788-.452 1.054 0 1.77.452.715.433 1.091 1.148.377.697.377 1.506 0 .828-.377 1.544a3.04 3.04 0 0 1-1.091 1.167q-.715.433-1.77.433m-.018-1.807q.602 0 .922-.396.32-.394.32-.922 0-.508-.32-.904-.32-.395-.922-.395-.584 0-.923.395-.32.396-.32.904 0 .527.32.922.34.396.922.396"})))}},67e3:function(e,t,n){n.d(t,{Z:function(){return o}});var a,s,r=n(67294);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let o=e=>{let{title:t,titleId:n,...o}=e;return r.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24","aria-labelledby":n},o),t?r.createElement("title",{id:n},t):null,a||(a=r.createElement("path",{fill:"#D9D9D9",d:"m8.03 10.666 5.472-5.821a1.7 1.7 0 0 1 2.507 0l5.472 5.821a1.973 1.973 0 0 1 0 2.668l-5.472 5.821a1.7 1.7 0 0 1-2.508 0L8.03 13.334a1.973 1.973 0 0 1 0-2.668"})),s||(s=r.createElement("path",{fill:"#000",fillRule:"evenodd",d:"M8.959 6.682a.84.84 0 0 1 .512-.174c.803 0 1.152 1.017.518 1.51l-2.77 2.151h8.374a.915.915 0 0 1 0 1.83H2.81a.274.274 0 0 1-.166-.491zM10.328 18.234a.84.84 0 0 1-.512.173c-.804 0-1.152-1.017-.518-1.51l2.77-2.151H3.694a.915.915 0 0 1 0-1.83h12.783c.262 0 .374.332.166.491z",clipRule:"evenodd"})))}},35335:function(e,t,n){n.d(t,{Z:function(){return o}});var a,s,r=n(67294);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let o=e=>{let{title:t,titleId:n,...o}=e;return r.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24","aria-labelledby":n},o),t?r.createElement("title",{id:n},t):null,a||(a=r.createElement("path",{fill:"#C9C9C9",d:"M14.466 11.24c.712.42.712 1.1 0 1.52l-8.355 4.923C4.963 18.36 3 17.881 3 16.924V7.076c0-.957 1.963-1.436 3.11-.76z"})),s||(s=r.createElement("path",{fill:"#000",fillRule:"evenodd",d:"M21 12c0-.7-.37-1.333-.968-1.77L10.98 3.622c-.929-.679-2.127-.749-3.066-.465C6.998 3.434 6 4.178 6 5.391V18.61c0 1.213.998 1.957 1.914 2.234.939.284 2.137.213 3.066-.465l9.052-6.608C20.63 13.333 21 12.7 21 12m-2 0c0 .038-.016.143-.189.269L9.76 18.878c-.314.23-.8.292-1.236.16-.458-.139-.523-.358-.523-.43V5.392c0-.071.065-.29.523-.429.435-.132.922-.07 1.236.16l9.052 6.61c.173.126.189.23.189.268",clipRule:"evenodd"})))}},16341:function(e,t,n){n.d(t,{Z:()=>y});var a=n("85893"),s=n("40254"),r=n("67294"),i=n("61167"),o=n("18424"),l=n("7670"),c=n("87262");let d=e=>{let{isLinkedSuccess:t,onResult:n,onLoading:s}=e,[d,u]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)(),{siteConfig:{customFields:g}}=(0,c.default)(),b="string"==typeof g.API_BASE_URI?g?.API_BASE_URI:null,f=new i.Z(b);return(0,a.jsx)("div",{className:"my-4",children:(0,a.jsx)(o.J,{text:(0,l.translate)({id:"page.Demo.step-2.RetrieveBalance.button.title",message:"Truy v\u1EA5n s\u1ED1 d\u01B0"}),onClick:()=>{let e=localStorage.getItem("accessToken");u(!0),s?.(!0),f.getBalance(e).then(e=>{m(!0),u(!1),x(e),s?.(!1),n?.(e)})},isLoading:d,disabled:d||!t})})},u=e=>{let{isLinkedSuccess:t,onResult:n,onLoading:s}=e,[d,u]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)(),[g,b]=(0,r.useState)(new Date(new Date().setDate(new Date().getDate()-14))),[f,y]=(0,r.useState)(new Date),{siteConfig:{customFields:v}}=(0,c.default)(),j="string"==typeof v?.API_BASE_URI?v?.API_BASE_URI:null,k=new i.Z(j);return(0,a.jsx)("div",{className:"my-4",children:(0,a.jsx)(o.J,{text:(0,l.translate)({id:"page.Demo.step-2.RetrieveTransaction.button.title",message:"Truy v\u1EA5n giao d\u1ECBch"}),onClick:()=>{let e=localStorage.getItem("accessToken");u(!0),s?.(!0),k.getTransactions(e,g.toISOString().slice(0,10),f.toISOString().slice(0,10)).then(e=>{e.errorCode||(m(!0),u(!1),x(e),s?.(!1),n?.(e)),e.errorCode&&(m(!0),u(!1),x(e),s?.(!1),n?.(e))})},isLoading:d,disabled:d||!t})})},h=e=>{let{isLinkedSuccess:t,accountType:n,onResult:s,onLoading:d}=e,[u,h]=(0,r.useState)(!1),[m,p]=(0,r.useState)(!1),[x,g]=(0,r.useState)(),[b,f]=(0,r.useState)(""),[y,v]=(0,r.useState)(""),[j,k]=(0,r.useState)(!1),w=()=>{p(!1),g(""),v(""),k(!1)};(0,r.useEffect)(()=>{w()},[n]);let{siteConfig:{customFields:N}}=(0,c.default)(),T="string"==typeof N?.API_BASE_URI?N?.API_BASE_URI:null,E=new i.Z(T);return(0,r.useEffect)(()=>{let e;return j&&(e=setInterval(()=>{E.check(x.qrPay.referenceNumber).then(t=>{t.data&&(v(t.data),k(!1),s?.({...x,qrUrl:b,webhookData:t.data}),clearInterval(e))})},2e3)),()=>{clearInterval(e)}},[j]),(0,a.jsxs)("div",{className:"my-4",children:[(0,a.jsx)(o.J,{text:(0,l.translate)({id:"page.Demo.step-2.qrPay.button.title",message:"T\u
11EA1o m\xe3 thanh to\xe1n"}),onClick:()=>{let e=localStorage.getItem("accessToken");w(),h(!0),d?.(!0),E.getQRPay(e).then(e=>{if(p(!0),h(!1),d?.(!1),!e.qrPay){g(e),s?.(e);return}let{qrUrl:t,...n}=e;g(n),f(t),k(!0),s?.({...n,qrUrl:t})})},isLoading:u,disabled:u||!t}),j&&(0,a.jsx)("p",{className:"text-xs text-gray-700 mt-2",children:"\u0110ang ch\u1EDD thanh to\xe1n..."})]})},m=e=>{let{isLinkedSuccess:t,onResult:n,onLoading:s}=e,[d,u]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)(),{siteConfig:{customFields:g}}=(0,c.default)(),b="string"==typeof g?.API_BASE_URI?g?.API_BASE_URI:null,f=new i.Z(b);return(0,a.jsx)("div",{className:"my-4",children:(0,a.jsx)(o.J,{text:(0,l.translate)({id:"page.Demo.step-2.RetrieveKYC.button.title",message:"Truy v\u1EA5n KYC"}),onClick:()=>{let e=localStorage.getItem("accessToken");u(!0),s?.(!0),f.getIdentity(e).then(e=>{m(!0),u(!1),x(e),s?.(!1),n?.(e)})},isLoading:d,disabled:d||!t})})},p=e=>{let{isLinkedSuccess:t,accountType:n,onResult:s,onLoading:d}=e,[u,h]=(0,r.useState)(!1),[m,p]=(0,r.useState)(!1),[x,g]=(0,r.useState)(),{siteConfig:{customFields:b}}=(0,c.default)(),f="string"==typeof b?.API_BASE_URI?b?.API_BASE_URI:null,y=new i.Z(f),v=()=>{p(!1),g("")};return(0,r.useEffect)(()=>{v()},[n]),(0,a.jsx)("div",{className:"my-4",children:(0,a.jsx)(o.J,{text:(0,l.translate)({id:"page.Demo.step-2.RetrieveKYC.button.title",message:"Truy v\u1EA5n EKYC"}),onClick:()=>{let e=localStorage.getItem("accessToken");h(!0),d?.(!0),y.getEkyc(e).then(e=>{p(!0),h(!1),g(e),d?.(!1),s?.(e)})},isLoading:u,disabled:u||!t})})},x=e=>{let{isLinkedSuccess:t,onResult:n,onLoading:s}=e,[d,u]=(0,r.useState)(!1),[h,m]=(0,r.useState)(new Date().getFullYear()-1),[p,x]=(0,r.useState)(new Date().getFullYear()),{siteConfig:{customFields:g}}=(0,c.default)(),b="string"==typeof g?.API_BASE_URI?g?.API_BASE_URI:null,f=new i.Z(b);return(0,a.jsxs)("div",{className:"my-4",children:[(0,a.jsxs)("div",{className:"flex gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"T\u1EEB n\u0103m"}),(0,a.jsx)("input",{type:"number",min:"2000",max:new Date().getFullYear(),value:h,onChange:e=>m(parseInt(e.target.value)),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-black"})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"\u0110\u1EBFn n\u0103m"}),(0,a.jsx)("input",{type:"number",min:"2000",max:new Date().getFullYear(),value:p,onChange:e=>x(parseInt(e.target.value)),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-black"})]})]}),(0,a.jsx)(o.J,{text:(0,l.translate)({id:"page.Demo.step-2.FinancialStatements.button.title",message:"Truy v\u1EA5n th\xf4ng tin thu\u1EBF"}),onClick:()=>{let e=localStorage.getItem("accessToken");u(!0),s?.(!0),f.getFinancialStatements(e,h,p).then(e=>{u(!1),s?.(!1),n?.(e)}).catch(e=>{u(!1),s?.(!1),n?.({errorCode:"API_ERROR",message:e.message})})},isLoading:d,disabled:d||!t})]})},g=e=>{let{isLinkedSuccess:t,onResult:n,onLoading:s}=e,[d,u]=(0,r.useState)(!1),[h,m]=(0,r.useState)(new Date(new Date().setDate(new Date().getDate()-30))),[p,x]=(0,r.useState)(new Date),{siteConfig:{customFields:g}}=(0,c.default)(),b="string"==typeof g?.API_BASE_URI?g?.API_BASE_URI:null,f=new i.Z(b);return(0,a.jsxs)("div",{className:"my-4",children:[(0,a.jsxs)("div",{className:"flex gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"T\u1EEB ng\xe0y"}),(0,a.jsx)("input",{type:"date",value:h.toISOString().slice(0,10),onChange:e=>m(new Date(e.target.value)),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-black"})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"\u0110\u1EBFn ng\xe0y"}),(0,a.jsx)("input",{type:"date",value:p.toISOString().slice(0,10),onChange:e=>x(new Date(e.target.value)),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-black"})]})]}),(0,a.jsx)(o.J,{text:(0,l.translate)({id:"page.Demo.step-2.GdtInvoices.button.title",message:"Truy v\u1EA5n h\xf3a \u0111\u01A1n"}),onClick:()=>{let e=localStorage.getItem("accessToken");u(!0),s?.(!0),f.getGdtInvoices(e,h.toISOString().slice(0,10),p.toISOString().slice(0,10)).then(e=>{u(!1),s?.(!1),n?.(e)}).catch(e=>{u(!1),s?.(!1),n?.({errorCode:"API_ERROR",message:e.message})})},isLoading:d,disabled:d||!t})]})},b=e=>{let{isLinkedSuccess:t,fromAccountNumber:n,onResult:s,onLoading:l}=e,[d,u]=(0,r.useState)(!1),{siteConfig:{customFields:h}}=(0,c.default)(),m="string"==typeof h?.API_BASE_URI?h?.API_BASE_URI:null,p=new i.Z(m);return(0,a.jsx)("div",{className:"my-4",children:(0,a.jsx)(o.J,{text:"Th\u1EF1c hi\u1EC7n chuy\u1EC3n ti\u1EC1n",onClick:()=>{let e=localStorage.getItem("accessToken"),t={fromAccountNumber:n,toBin:"970415",toAccountNumber:"22102025",amount:11111,description:"Chuyen tien demo Cas Link"};u(!0),l?.(!0),p.transfer(e,t).then(e=>{u(!1),l?.(!1),s?.({request:t,response:e})})},isLoading:d,disabled:d||!t||!n})})},f=e=>{let{isLinkedSuccess:t,fromAccountNumber:n,onResult:s,onLoading:l}=e,[d,u]=(0,r.useState)(!1),{siteConfig:{customFields:h}}=(0,c.default)(),m="string"==typeof h?.API_BASE_URI?h?.API_BASE_URI:null,p=new i.Z(m);return(0,a.jsx)("div",{className:"my-4",children:(0,a.jsx)(o.J,{text:"L\u1EADp l\u1EC7nh chuy\u1EC3n kho\u1EA3n",onClick:()=>{let e=localStorage.getItem("accessToken"),t={referenceId:Date.now().toString(),fromAccountNumber:n,toBin:"970415",toAccountNumber:"22102025",amount:11111,description:"Lap lenh demo Cas Link"};u(!0),l?.(!0),p.paymentInitiation(e,t).then(e=>{u(!1),l?.(!1),s?.({request:t,response:e})})},isLoading:d,disabled:d||!t||!n})})},y=e=>{let{isLinkedSucess:t,product:n,accountType:r,fromAccountNumber:i,onResult:o,onLoading:l}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)(a.Fragment,{children:n==s.c5.TRANSACTION&&(0,a.jsx)(u,{isLinkedSuccess:t,onResult:o,onLoading:l})}),(0,a.jsx)(a.Fragment,{children:n==s.c5.ACCOUNT&&(0,a.jsx)(d,{isLinkedSuccess:t,onResult:o,onLoading:l})}),(0,a.jsx)(a.Fragment,{children:n==s.c5.IDENTITY&&(0,a.jsx)(m,{isLinkedSuccess:t,onResult:o,onLoading:l})}),(0,a.jsx)(a.Fragment,{children:n==s.c5.QRPAY&&(0,a.jsx)(h,{isLinkedSuccess:t,accountType:r,onResult:o,onLoading:l})}),(0,a.jsx)(a.Fragment,{children:n==s.c5.EKYC&&(0,a.jsx)(p,{isLinkedSuccess:t,accountType:r,onResult:o,onLoading:l})}
1),(0,a.jsx)(a.Fragment,{children:n==s.c5.ETAX&&(0,a.jsx)(x,{isLinkedSuccess:t,onResult:o,onLoading:l})}),(0,a.jsx)(a.Fragment,{children:n==s.c5.GDT_INVOICES&&(0,a.jsx)(g,{isLinkedSuccess:t,onResult:o,onLoading:l})}),(0,a.jsx)(a.Fragment,{children:n==s.c5.TRANSFER&&(0,a.jsx)(b,{isLinkedSuccess:t,fromAccountNumber:i||"",onResult:o,onLoading:l})}),(0,a.jsx)(a.Fragment,{children:n==s.c5.PAYMENT_INITIATION&&(0,a.jsx)(f,{isLinkedSuccess:t,fromAccountNumber:i||"",onResult:o,onLoading:l})})]})}},18424:function(e,t,n){n.d(t,{J:function(){return i}});var a=n(85893),s=n(12012),r=n(97571);n(67294);let i=e=>(0,a.jsx)(s.Z,{onClick:()=>{e.onClick()},className:"flex gap-4 w-48 items-center justify-center !capitalize !text-[16px] rounded-md !text-white !bg-black disabled:!opacity-40 p-2 my-2 hover:!bg-[#15ab64]",disabled:e.disabled,children:e.isLoading?(0,a.jsx)(r.Z,{className:"!w-[25px] !h-[25px] !text-white"}):(0,a.jsx)("span",{children:e.text})})},55173:function(e,t,n){n.d(t,{Z:function(){return d}});var a=n(85893);n(67294);var s=n(7574),r=n(85285),i=n(11601),o=n(80016),l=n(52293);let c=[{code:"vn",name:"Vietnam",flag:"\uD83C\uDDFB\uD83C\uDDF3"},{code:"kh",name:"Cambodia",flag:"\uD83C\uDDF0\uD83C\uDDED"},{code:"th",name:"Thailand",flag:"\uD83C\uDDF9\uD83C\uDDED"},{code:"id",name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},{code:"my",name:"Malaysia",flag:"\uD83C\uDDF2\uD83C\uDDFE"}],d=e=>{let{control:t}=e;return(0,a.jsxs)(s.Z,{fullWidth:!0,children:[(0,a.jsx)(r.Z,{id:"country-select-label",children:"Select Country"}),(0,a.jsx)(l.Qr,{name:"country",control:t,render:e=>{let{field:t}=e;return(0,a.jsx)(i.Z,{labelId:"country-select-label",id:"country-select",label:"Select Country",...t,children:c.map(e=>(0,a.jsx)(o.Z,{value:e.code,children:`${e.flag} ${e.name}`},e.code))})}})]})}},8822:function(e,t,n){n.d(t,{Z:function(){return i}});var a=n(85893);n(67294);var s=n(27262),r=n.n(s);let i=e=>{let{jsonData:t}=e;return(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(r(),{id:"json-pretty",data:t,mainStyle:"max-width:800px"})})}},82709:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(85893);n(67294);let s=e=>{let{status:t}=e;return(0,a.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${{Stable:"bg-black text-white",Beta:"bg-gray-800 text-white",Alpha:"bg-gray-600 text-white","Coming Soon":"bg-gray-400 text-white"}[t]}`,children:t})}},77008:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(85893);n(67294);let s=e=>{let{children:t}=e;return(0,a.jsx)("div",{className:"flex flex-col lg:flex-row w-full mx-auto min-h-screen",children:t})}},20588:function(e,t,n){n.d(t,{Z:()=>R});var a=n("85893"),s=n("67294"),r=n("16550"),i=n("52293"),o=n("73054"),l=n.n(o),c=n("87262"),d=n("83187"),u=n("7670"),h=n("46470"),m=n("61167"),p=n("77008"),x=n("6895"),g=n("55173");let b=e=>{let{control:t,fieldName:n,options:s,labels:r={}}=e,o={personal:(0,u.translate)({id:"newDemo.accountType.personal",message:"C\xe1 nh\xe2n"}),enterprise:(0,u.translate)({id:"newDemo.accountType.enterprise",message:"Doanh nghi\u1EC7p"}),business:(0,u.translate)({id:"newDemo.accountType.business",message:"Doanh nghi\u1EC7p"}),all:(0,u.translate)({id:"newDemo.accountType.all",message:"T\u1EA5t c\u1EA3"}),popup:"Popup",redirect:"Redirect"},l=e=>r[e]||o[e]||e.charAt(0).toUpperCase()+e.slice(1);return(0,a.jsx)(i.Qr,{name:n,control:t,render:e=>{let{field:t}=e;return(0,a.jsx)("div",{className:"flex gap-2 flex-wrap",children:s.map(e=>{let n=t.value===e;return(0,a.jsx)("button",{type:"button",onClick:()=>t.onChange(e),className:` 2 px-4 py-2 rounded-lg text-sm font-medium transition-all 3 border-2 shadow-sm 4 ${n?"bg-black text-white border-black shadow-md":"bg-white text-gray-700 border-gray-300 hover:border-gray-400 hover:bg-gray-50 hover:shadow-md"} 5 `,children:l(e)},e)})})}})};var f=n("16341"),y=n("35363");let v=e=>{let{currentStep:t,isLinkedSuccess:n,productName:s="s\u1EA3n ph\u1EA9m",product:r,control:i,isLoading:o,onLinkBank:l,onUpdateMode:d,onBack:h,watchedValueAccountType:m,onStep2Result:p,onStep2Loading:v,onStep3Result:j,onStep3Loa
5ding:k,onStep4Result:w,step2Result:N,step3Result:T,expandedSteps:E,onToggleStep:S}=e,{siteConfig:{customFields:R},i18n:{currentLocale:C}}=(0,c.default)(),D=R?.SHOW_COUNTRY_SELECTION==="true",I=R?.SHOW_UPDATE_MODE==="true",A=r.integrationSteps||[],L=(0,x.I)(C,r.name,r.nameEn);return(0,a.jsxs)("aside",{id:"cas-link-container",className:"w-full lg:w-1/2 min-h-auto lg:min-h-screen bg-gray-50 border-b lg:border-b-0 lg:border-r border-black py-8 px-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-8",children:[(0,a.jsx)("svg",{className:"w-5 h-5 text-black",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{d:"M2 6a2 2 0 012-2h5l2 2h5a2 2 0 012 2v6a2 2 0 01-2 2H4a2 2 0 01-2-2V6z"})}),(0,a.jsx)("span",{onClick:h,className:"text-sm font-medium text-gray-700 hover:text-black cursor-pointer transition-colors",children:(0,a.jsx)(u.default,{id:"newDemo.sidebar.breadcrumb",children:"Danh m\u1EE5c s\u1EA3n ph\u1EA9m"})}),(0,a.jsx)("span",{className:"text-sm text-gray-500",children:"/"}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(y.Z,{productId:r.id,className:"w-4 h-4 text-black"}),(0,a.jsx)("span",{className:"text-sm font-medium text-black",children:L})]})]}),(0,a.jsx)("h2",{className:"text-xl font-bold mb-4 text-black",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.title",children:"C\xe1c b\u01B0\u1EDBc t\xedch h\u1EE3p API"})}),(0,a.jsx)("p",{className:"text-sm text-gray-900 mb-6 leading-relaxed",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.description",values:{productName:(0,a.jsx)("span",{className:"font-bold",children:L})},children:"D\u01B0\u1EDBi \u0111\xe2y l\xe0 DEMO c\xe1c b\u01B0\u1EDBc t\xedch h\u1EE3p gi\u1EA3i ph\xe1p {productName} v\xe0o h\u1EC7 th\u1ED1ng c\u1EE7a b\u1EA1n. Ch\xfang t\xf4i cung c\u1EA5p c\xe1c endpoint chu\u1EA9n RESTful \u0111\u1EC3 \u0111\u1EA3m b\u1EA3o s\u1EF1 linh ho\u1EA1t t\u1ED1i \u0111a."})}),(0,a.jsx)("div",{className:"space-y-3",children:A.map(e=>{let s=1===e.number&&n,c=e.number===t,h=E[e.number]??!1,y=(0,x.I)(C,e.title,e.titleEn);return(0,a.jsxs)("div",{className:"border-l-4 border-black",children:[(0,a.jsxs)("div",{onClick:()=>S(e.number),className:` 6 flex items-start gap-3 p-4 cursor-pointer 7 ${c?"bg-gray-100":"hover:bg-gray-50"} 8 `,children:[(0,a.jsx)("div",{className:` 9 w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0 10 ${s?"bg-black text-white":"border-2 border-gray-400"} 11 `,children:s?(0,a.jsx)("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):(0,a.jsx)("span",{className:"text-xs font-bold text-gray-600",children:e.number})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)("p",{className:"text-base m-0 font-bold text-black",children:y})}),(0,a.jsx)("svg",{className:`w-5 h-5 text-gray-600 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&(0,a.jsxs)("div",{className:"p-6 bg-gray-100",children:[1===e.number&&(0,a.jsxs)(a.Fragment,{children:[D&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"block text-sm font-bold mb-2 text-black",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.chooseRegion",children:"Ch\u1ECDn khu v\u1EF1c"})}),(0,a.jsx)(g.Z,{control:i})]}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"block text-sm font-bold mb-2 text-black",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.chooseAccountType",children:"Ch\u1ECDn lo\u1EA1i t\xe0i kho\u1EA3n"})}),(0,a.jsx)(b,{control:i,fieldName:"accountType",options:r.accountTypes.map(e=>e.toLowerCase())})]}),I&&(0,a.jsx)("p",{onClick:d,className:"font-bold text-black underline underline-offset-1 hover:cursor-pointer mb-4",children:"Update Mode?"}),(0,a.jsx)("button",{onClick:l,disabled:o,className:"flex gap-2 w-48 items-center justify-center text-[16px] rounded-md text-white bg-black disabled:opacity-40 p-2 my-2 hover:bg-gray-800 transition-colors",children:o?(0,a.jsx)("div",{className:"flex gap-2 items-center relative z-10",children:(0,a.jsx)("span",{className:"text-white",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.openingCasLink",children:"\u0110ang m\u1EDF Cas Link..."})})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.connectVia",children:"K\u1EBFt n\u1ED1i qua"})}),(0,a.jsx)("img",{src:"/img/cas.png",alt:"Cas",className:"h-4 inline-block"})]})}),(0,a.jsx)("p",{className:"text-sm text-gray-700 mt-1 mb-0",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.connectNote",values:{button:(0,a.jsxs)("span",{className:"whitespace-nowrap",children:["\u201C",(0,a.jsx)(u.default,{id:"component.HowItWorks.button",children:"Li\xean k\u1EBFt ng\xe2n h\xe0ng"}),"\u201D"]})},children:"Trong \u1EE9ng d\u1EE5ng th\u1EADt, \u0111\xe2y l\xe0 n\xfat {button} kh\xe1ch h\xe0ng s\u1EBD b\u1EA5m."})})]}),2===e.number&&(0,a.jsx)(a.Fragment,{children:n?(0,a.jsx)(a.Fragment,{children:(()=>{let e="";switch(r.id){case"auto-debit":case"transaction":case"einvoice":e="transaction";break;case"qrpay":e="qrpay";break;case"ekyc":e="ekyc";break;case"virtual-account":case"balance-hook":e="account";break;case"idkit":case"payout":case"payment-initiation":e="identity";break;case"etax":e="etax";break;case"invoice":e="gdt_invoices";break;default:"transaction"===r.scopes?e="transaction":"qrpay"===r.scopes?e="qrpay":"ekyc"===r.scopes?e="ekyc":"balance"===r.scopes?e="account":"identity"===r.scopes&&(e="identity")}return e?(0,a.jsx)(f.Z,{isLinkedSucess:n,product:e,accountType:m,onResult:p,onLoading:v}):(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.featureInDevelopment",children:"T\xednh n\u0103ng n\xe0y \u0111ang \u0111\u01B0\u1EE3c ph\xe1t tri\u1EC3n."})})})()}):(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.completeStep1First",values:{step:(0,a.jsx)("span",{className:"font-bold",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.step1Label",children:"B\u01B0\u1EDBc 1: K\u1EBFt n\u1ED1i ng\xe2n h\xe0ng"})})},children:"Vui l\xf2ng ho\xe0n th\xe0nh {step} tr\u01B0\u1EDBc."})})}
11),3===e.number&&(0,a.jsxs)(a.Fragment,{children:["payout"===r.id&&(0,a.jsx)(a.Fragment,{children:N?(0,a.jsx)(f.Z,{isLinkedSucess:n,product:"transfer",accountType:m,fromAccountNumber:N?.accounts?.[0]?.accountNumber||"",onResult:j,onLoading:k}):(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.completeStep2AccountFirst",values:{step:(0,a.jsx)("span",{className:"font-bold",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.step2AccountLabel",children:"B\u01B0\u1EDBc 2: L\u1EA5y th\xf4ng tin t\xe0i kho\u1EA3n"})})},children:"Vui l\xf2ng ho\xe0n th\xe0nh {step} tr\u01B0\u1EDBc."})})}),"payment-initiation"===r.id&&(0,a.jsx)(a.Fragment,{children:N?(0,a.jsx)(f.Z,{isLinkedSucess:n,product:"payment_initiation",accountType:m,fromAccountNumber:N?.accounts?.[0]?.accountNumber||"",onResult:j,onLoading:k}):(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.completeStep2AccountFirst",values:{step:(0,a.jsx)("span",{className:"font-bold",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.step2AccountLabel",children:"B\u01B0\u1EDBc 2: L\u1EA5y th\xf4ng tin t\xe0i kho\u1EA3n"})})},children:"Vui l\xf2ng ho\xe0n th\xe0nh {step} tr\u01B0\u1EDBc."})})}),"qrpay"===r.id&&(0,a.jsx)(a.Fragment,{children:T?.qrUrl?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,a.jsx)("img",{src:T.qrUrl,alt:"VietQR Payment Code",className:"w-full max-w-[300px] h-auto border-2 border-gray-300 rounded"}),(0,a.jsxs)("p",{className:"text-xs text-gray-700 text-center italic",children:["\uD83D\uDCA1 ",(0,a.jsx)(u.default,{id:"newDemo.qr.scanHint",children:"Qu\xe9t m\xe3 QR \u0111\u1EC3 thanh to\xe1n"})]})]}):(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.qrAutoDisplay",children:"M\xe3 QR s\u1EBD t\u1EF1 \u0111\u1ED9ng hi\u1EC3n th\u1ECB khi ho\xe0n th\xe0nh b\u01B0\u1EDBc 2."})})})]}),e.number>3&&(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.integrationSteps.autoResultOnRight",children:"K\u1EBFt qu\u1EA3 s\u1EBD t\u1EF1 \u0111\u1ED9ng hi\u1EC3n th\u1ECB \u1EDF b\xean ph\u1EA3i khi ho\xe0n th\xe0nh b\u01B0\u1EDBc tr\u01B0\u1EDBc."})})]})]},e.number)})})]})};var j=n("82709"),k=n("8822");let w=(e,t,n,a,s,r)=>{let i=`https://sandbox.bankhub.dev${t}`;if(s){let e=new URLSearchParams(s).toString();e&&(i+=`?${e}`)}let o=`curl -X ${e} '${i}' \\ 12`;return r||(o+=` -H 'x-client-id: env.CLIENT_ID' \\ 13 -H 'x-secret-key: env.SECRET_KEY' \\ 14`),"/grant/token"===t||"/grant/exchange"===t||void 0===n||(o+=` -H 'Authorization: Bearer ${n||"env.ACCESS_TOKEN"}' \\ 15`),o+=" -H 'Content-Type: application/json'",a&&"POST"===e&&(o+=` \\ 16 -d '${JSON.stringify(a,null,2).replace(/\n/g,"\n ")}'`),o},N=e=>({etax:{user:"0999001100-QL",pass:"soproud"},invoice:{user:"0999001100",pass:"soproud"}})[e]||{user:"bankusrdemo1",pass:"soproud"},T=e=>{let t=[{number:1,title:"T\u1EA1o Grant Token",titleEn:"Create Grant Token"},{number:2,title:"M\u1EDF Cas Link",titleEn:"Open Cas Link"},{number:3,title:"\u0110\u1ED5i Public Token",titleEn:"Exchange Public Token"}];if("qrpay"===e.id)return[...t,{number:4,title:"T\u1EA1o m\xe3 thanh to\xe1n",titleEn:"Create Payment Code"},{number:5,title:"Qu\xe9t m\xe3 QR",titleEn:"Scan QR Code"},{number:6,title:"Nh\u1EADn Webhook",titleEn:"Receive Webhook"}];if("payout"===e.id)return[...t,{number:4,title:"L\u1EA5y th\xf4ng tin t\xe0i kho\u1EA3n",titleEn:"Get Account Information"},{number:5,title:"Th\u1EF1c hi\u1EC7n chuy\u1EC3n ti\u1EC1n",titleEn:"Execute Payout"}];if("payment-initiation"===e.id)return[...t,{number:4,title:"L\u1EA5y th\xf4ng tin t\xe0i kho\u1EA3n",titleEn:"Get Account Information"},{number:5,title:"L\u1EADp l\u1EC7nh chuy\u1EC3n kho\u1EA3n",titleEn:"Create Payment Initiation"}];let n=e.integrationSteps.find(e=>2===e.number);return n?[...t,{number:4,title:n.title,titleEn:n.titleEn}]:t},E=e=>{let{product:t,isLinkedSuccess:n,grantTokenResult:r,publicToken:i,tokenResult:o,country:l,accountType:d,iframe:h,step2Result:m,step2Loading:p,step3Result:g,step3Loading:b,step4Result:f,expandedSteps:y,onToggleStep:v}=e,{siteConfig:{customFields:E},i18n:{currentLocale:S}}=(0,c.default)(),R="string"==typeof E?.REDIRECT_URI?E?.REDIRECT_URI:"undefined"!=typeof window?window.location.origin:"",C="ekyc"===t.scopes?`${t.scopes}:${d}
16`:t.scopes,D=T(t),[I,A]=(0,s.useState)(1),[L,P]=(0,s.useState)({1:"request",2:"request",3:"request",4:"response",5:"request",6:"response"}),q=s.useRef(!1),O=s.useRef(!1),_=s.useRef(!1),B=s.useRef(!1),U=s.useRef(!1),Z=s.useRef({});(0,s.useEffect)(()=>{let e=Z.current[I];e&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[I]),(0,s.useEffect)(()=>{r?.grantToken&&!q.current&&1===I&&(A(2),q.current=!0)},[r?.grantToken]),(0,s.useEffect)(()=>{i&&!O.current&&2===I&&(A(3),O.current=!0)},[i]),(0,s.useEffect)(()=>{n&&!_.current&&3===I&&(A(4),_.current=!0)},[n]),(0,s.useEffect)(()=>{g&&!B.current&&("payout"===t.id||"payment-initiation"===t.id)&&(A(5),B.current=!0)},[g]),(0,s.useEffect)(()=>{f&&!U.current&&(A(6),U.current=!0)},[f]),(0,s.useEffect)(()=>{r?.grantToken&&P(e=>({...e,1:"response"}))},[r?.grantToken]),(0,s.useEffect)(()=>{i&&P(e=>({...e,2:"response"}))},[i]),(0,s.useEffect)(()=>{n&&P(e=>({...e,3:"response"}))},[n]),(0,s.useEffect)(()=>{m&&P(e=>({...e,4:"response"}))},[m]),(0,s.useEffect)(()=>{if(g){let e=("payout"===t.id||t.id,5);P(t=>({...t,[e]:"response"}))}},[g]),(0,s.useEffect)(()=>{f&&P(e=>({...e,6:"request"}))},[f]);let M="payout"===t.id||"payment-initiation"===t.id,H=e=>1===e||(2===e?!!r?.grantToken:3===e?!!i||n:4===e?n:5===e?M?!!m:!!m?.qrPay:6===e&&!!g),F=e=>1===e?!!r?.grantToken:2===e?!!i:3===e?n:4===e?!!m:5===e?!!g:6===e&&!!f,G=(e,t)=>{let n=L[e];return(0,a.jsx)("div",{className:"border-b border-gray-300 mb-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:()=>P({...L,[e]:"request"}),className:` 17 px-4 py-2 font-medium text-sm border-b-2 -mb-[1px] transition-all 18 ${"request"===n?"border-black text-black":"border-transparent text-gray-600 hover:text-black hover:border-gray-300"} 19 `,children:"Request"}),(0,a.jsx)("button",{onClick:()=>P({...L,[e]:"response"}),disabled:!t,className:` 20 px-4 py-2 font-medium text-sm border-b-2 -mb-[1px] transition-all 21 ${"response"===n?"border-black text-black":t?"border-transparent text-gray-600 hover:text-black hover:border-gray-300":"border-transparent text-gray-400 cursor-not-allowed"} 22 `,children:"Response"})]})})};return(0,a.jsxs)("div",{className:"w-full lg:w-1/2 p-8 bg-white",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsxs)("h1",{className:"text-3xl font-bold m-0 text-black",children:["Cas Link Demo - ",(0,x.I)(S,t.name,t.nameEn)]}),(0,a.jsx)(j.Z,{status:t.status})]}),(0,a.jsx)("p",{className:"text-gray-900 text-base",children:(0,x.I)(S,t.description,t.descriptionEn)})]}),(0,a.jsxs)("div",{className:"mb-6 p-3 bg-gray-50 border-l-4 border-black",children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-black",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.demoCredentialsTitle",children:"Th\xf4ng tin \u0111\u0103ng nh\u1EADp DEMO"})}),(0,a.jsxs)("div",{className:"flex items-center gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-bold text-gray-700",children:"User:"}),(0,a.jsx)("code",{className:"px-1.5 py-0.5 bg-white border border-gray-300 rounded text-xs font-mono",children:N(t.id).user})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-bold text-gray-700",children:"Pass:"}),(0,a.jsx)("code",{className:"px-1.5 py-0.5 bg-white border border-gray-300 rounded text-xs font-mono",children:N(t.id).pass})]})]})]}),(0,a.jsx)("div",{className:"border-b border-gray-300 mb-6",children:(0,a.jsx)("div",{className:"flex gap-1 overflow-x-auto",children:D.map(e=>{let t=H(e.number),n=F(e.number),s=I===e.number;return(0,a.jsxs)("button",{ref:t=>{Z.current[e.number]=t},onClick:()=>t&&A(e.number),disabled:!t,className:` 23 flex items-center gap-2 px-3 py-2 font-medium text-xs 24 border-b-2 -mb-[1px] transition-all relative rounded-t-md 25 whitespace-nowrap 26 ${s?"border-black text-black bg-gray-50":t?"border-transparent text-gray-600 hover:text-black hover:border-gray-300 hover:bg-gray-50":"border-transparent text-gray-400 cursor-not-allowed"} 27 `,children:[(0,a.jsx)("span",{className:` 28 w-4 h-4 rounded-full flex items-center justify-center text-[10px] font-bold 29 flex-shrink-0 30 ${n?"bg-black text-white":s?"bg-black text-white":t?"bg-gray-200 text-gray-700":"bg-gray-100 text-gray-400"} 31 `,children:n?"\u2713":e.number}),(0,a.jsx)("span",{children:(0,x.I)(S,e.title,e.titleEn)})]},e.number)})})}),(0,a.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-6",children:(()=>{switch(I){case 1:let e=L[1];return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-black",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.configuration",children:"C\u1EA5u h\xecnh"})}),(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsxs)("div",{className:"space-y-2 text-xs",children:[(0,a.jsxs)("div",{className:"flex items-start",children:[(0,a.jsx)("span",{className:"font-bold text-gray-700 w-32",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.region",children:"Khu v\u1EF1c:"})}),(0,a.jsx)("span",{className:"text-gray-900 font-mono",children:l.toUpperCase()})]}),(0,a.jsxs)("div",{className:"flex items-start",children:[(0,a.jsx)("span",{className:"font-bold text-gray-700 w-32",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.accountType",children:"Lo\u1EA1i t\xe0i kho\u1EA3n:"})}),(0,a.jsx)("span",{className:"text-gray-900 font-mono",children:d.toUpperCase()})]}),(0,a.jsxs)("div",{className:"flex items-start",children:[(0,a.jsx)("span",{className:"font-bold text-gray-700 w-32",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.displayType",children:"Ki\u1EC3u hi\u1EC3n th\u1ECB:"})}),(0,a.jsx)("span",{className:"text-gray-900 font-mono",children:"popup"===h?"Popup":"Redirect"})]}),(0,a.jsxs)("div",{className:"flex items-start",children:[(0,a.jsx)("span",{className:"font-bold text-gray-700 w-32",children:"Scopes:"}),(0,a.jsx)("span",{className:"text-gray-900 font-mono",children:C})]})]})})]}),(0,a.jsxs)("div",{className:"mb-4 p-4 bg-blue-50 border-l-4 border-blue-500 rounded",children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-blue-900",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.step1.title",children:"B\u01B0\u1EDBc 1: T\u1EA1o Grant Token"})}),(0,a.jsx)("p",{className:"text-xs text-blue-800",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.step1.description",values:{grantToken:(0,a.jsx)("strong",{children:"grantToken"})},children:"G\u1ECDi API POST /grant/token v\u1EDBi th\xf4ng tin c\u1EA5u h\xecnh (country, scopes, redirectUri) \u0111\u1EC3 kh\u1EDFi t\u1EA1o ti\u1EBFn tr\xecnh ph\xe2n quy\u1EC1n. API
31s\u1EBD tr\u1EA3 v\u1EC1 {grantToken} d\xf9ng \u0111\u1EC3 m\u1EDF CasLink."})})]}),G(1,!!r?.grantToken),"request"===e&&(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:w("POST","/grant/token",void 0,{country:l,redirectUri:R,scopes:C,language:"vi",...t.fiServiceId&&{fiServiceId:t.fiServiceId}})})}),"response"===e&&(0,a.jsx)("div",{children:r?.grantToken?(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)(k.Z,{jsonData:{requestId:r.requestId,grantToken:r.grantToken,expiredAt:r.expiredAt}})}):(0,a.jsx)("p",{className:"text-sm text-gray-700 italic",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.pressButtonHint",values:{button:(0,u.translate)({id:"newDemo.demoResult.step1.buttonLabel",message:"T\u1EA1o Grant Token"})},children:'Nh\u1EA5n n\xfat "{button}" \u1EDF b\xean tr\xe1i \u0111\u1EC3 th\u1EF1c hi\u1EC7n b\u01B0\u1EDBc n\xe0y.'})})})]});case 2:if(!r?.grantToken)return(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.completeTabFirst",values:{tab:(0,u.translate)({id:"newDemo.demoResult.tab1Ref",message:"Tab 1 (T\u1EA1o Grant Token)"})},children:"Vui l\xf2ng ho\xe0n th\xe0nh {tab} tr\u01B0\u1EDBc."})});let s=L[2];return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-4 p-4 bg-blue-50 border-l-4 border-blue-500 rounded",children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-blue-900",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.step2.title",children:"B\u01B0\u1EDBc 2: M\u1EDF CasLink"})}),(0,a.jsx)("p",{className:"text-xs text-blue-800",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.step2.description",values:{grantToken:(0,a.jsx)("strong",{children:"grantToken"}),publicToken:(0,a.jsx)("strong",{children:"publicToken"})},children:"S\u1EED d\u1EE5ng {grantToken} nh\u1EADn \u0111\u01B0\u1EE3c t\u1EEB b\u01B0\u1EDBc 1 \u0111\u1EC3 t\u1EA1o URL v\xe0 m\u1EDF giao di\u1EC7n CasLink. User s\u1EBD li\xean k\u1EBFt t\xe0i kho\u1EA3n ng\xe2n h\xe0ng t\u1EA1i \u0111\xe2y, sau khi ho\xe0n th\xe0nh s\u1EBD nh\u1EADn \u0111\u01B0\u1EE3c {publicToken} qua redirectUri."})})]}),G(2,!!i),"request"===s&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"bg-white border border-gray-300 rounded p-3 mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-bold text-gray-700 mb-2",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.caslinkUrl",children:"URL CasLink:"})}),(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:`https://dev.link.bankhub.dev?grantToken=${r?.grantToken||"<GRANT_TOKEN>"}&redirectUri=${encodeURIComponent(R)}${t.feature&&"all"!==t.feature?`&feature=${t.feature}`:""}${"popup"===h?"&iframe=true":""}`})]}),(0,a.jsxs)("p",{className:"text-xs text-gray-600 italic",children:["\uD83D\uDCA1"," ",(0,a.jsx)(u.default,{id:"newDemo.demoResult.clickConnectHint",values:{button:(0,u.translate)({id:"newDemo.integrationSteps.connectViaCasLabel",message:"K\u1EBFt n\u1ED1i qua Cas"})},children:'Click n\xfat "{button}" \u1EDF b\xean tr\xe1i \u0111\u1EC3 m\u1EDF giao di\u1EC7n li\xean k\u1EBFt ng\xe2n h\xe0ng.'})]})]}),"response"===s&&(0,a.jsx)("div",{children:i?(0,a.jsxs)("div",{className:"bg-white border border-gray-300 rounded p-3",children:[(0,a.jsx)("p",{className:"text-xs font-bold text-gray-700 mb-2",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.callbackUrl",children:"Callback URL nh\u1EADn k\u1EBFt qu\u1EA3:"})}),(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:`${R}?publicToken=${i}${o?.state?`&state=${o.state}`:""}`})]}):(0,a.jsx)("p",{className:"text-sm text-gray-700 italic",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.publicTokenPending",children:"Ch\u01B0a nh\u1EADn \u0111\u01B0\u1EE3c publicToken. Vui l\xf2ng ho\xe0n th\xe0nh b\u01B0\u1EDBc m\u1EDF CasLink."})})})]});case 3:if(!i)return(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.completeTabFirst",values:{tab:(0,u.translate)({id:"newDemo.demoResult.tab2Ref",message:"Tab 2 (M\u1EDF Cas Link)"})},children:"Vui l\xf2ng ho\xe0n th\xe0nh {tab} tr\u01B0\u1EDBc."})});let c=L[3];return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-4 p-4 bg-blue-50 border-l-4 border-blue-500 rounded",children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-blue-900",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.step3.title",children:"B\u01B0\u1EDBc 3: \u0110\u1ED5i Public Token th\xe0nh Access Token"})}),(0,a.jsx)("p",{className:"text-xs text-blue-800",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.step3.description",values:{publicToken:(0,a.jsx)("strong",{children:"publicToken"}),accessToken:(0,a.jsx)("strong",{children:"accessToken"})},children:"Sau khi nh\u1EADn \u0111\u01B0\u1EE3c {publicToken} t\u1EEB callback, g\u1ECDi API POST /grant/exchange \u0111\u1EC3 \u0111\u1ED5i publicToken th\xe0nh {accessToken}. accessToken n\xe0y s\u1EBD \u0111\u01B0\u1EE3c d\xf9ng cho t\u1EA5t c\u1EA3 c\xe1c API calls ti\u1EBFp theo."})})]}),G(3,n),"request"===c&&(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:w("POST","/grant/exchange",void 0,{publicToken:i})})}),"response"===c&&(0,a.jsx)("div",{children:n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3 mb-4",children:(0,a.jsx)(k.Z,{jsonData:o})}),(0,a.jsx)("div",{className:"p-3 bg-green-50 border-l-4 border-green-500 rounded",children:(0,a.jsx)("p",{className:"text-xs text-green-800",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.step3.success",values:{done:(0,a.jsx)("strong",{children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.done",children:"Ho\xe0n th\xe0nh!"})})},children:"{done} Access Token \u0111\xe3 \u0111\u01B0\u1EE3c t\u1EA1o th\xe0nh c\xf4ng. B\u1EA1n c\xf3 th\u1EC3 s\u1EED d\u1EE5ng accessToken n\xe0y \u0111\u1EC3 g\u1ECDi c\xe1c API \u1EDF tab ti\u1EBFp theo."})})})]}):(0,a.jsx)("p",{className:"text-sm text-gray-700 italic",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.pressButtonHint",values:{button:(0,u.translate)({id:"newDemo.demoResult.step3.buttonLabel",message:"\u0110\u1ED5i Public Token"})},children:'Nh\u1EA5n n\xfat "{button}" \u1EDF b\xean tr\xe1i \u0111\u1EC3 th\u1EF1c hi\u1EC7n b\u01B0\u1EDBc n\xe0y.'})})})]});case 4:let y,v;if(!n)return(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.completeTabFirst",values:{tab:(0,u.translate)({id:"newDemo.demoResult.tab3Ref",message:"Tab 3 (\u0110\u1ED5i Public Token)"})},children:"Vui l\xf2ng ho\xe0n th\xe0nh {tab} tr\u01B0\u1EDBc."})});if(M){let e=L[4];return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-4 p-4 bg-blue-50 border-l-4 border-blue-500 rounded",children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-blue-900",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.step4Identity.title",children:"B\u01B0\u1EDBc 4: L\u1EA5y th\xf4ng tin t\xe0i kho\u1EA3n ngu\u1ED3n"})}),(0,a.jsx)("p",{className:"text-xs text-blue-800",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.step4Identity.description",values:{fromAccountNumber:(0,a.jsx)("strong",{children:"fromAccountNumber"})},children:"G\u1ECDi GET /identity \u0111\u1EC3 l\u1EA5y danh s\xe1ch t\xe0i kho\u1EA3n ng\xe2n h\xe0ng \u0111\xe3 li\xean k\u1EBFt. L\u1EA5y {fromAccountNumber} t\u1EEB k\u1EBFt qu\u1EA3 \u2014 tr\u01B0\u1EDDng n\xe0y \u0111\u01B0\u1EE3c d\xf9ng \u1EDF b\u01B0\u1EDBc ti\u1EBFp theo, kh\xf4ng c\u1EA7n g\u1ECDi l\u1EA1i."})})]}),G(4,!!m),"request"===e&&(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:w("GET","/identity",o?.accessToken||null)})}),"response"===e&&(0,a.jsx)("div",{children:m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3 mb-3",children:(0,a.jsx)(k.Z,{jsonData:m})}),m?.accounts?.[0]?.accountNumber&&(0,a.jsx)("div",{className:"p-3 bg-green-50 border-l-4 border-green-500 rounded",children:(0,a.jsx)("p",{className:"text-xs text-green-800",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.fromAccountNumberHint",values:{label:(0,a.jsx)("strong",{children:"fromAccountNumber:"}),value:(0,a.jsx)("code",{className:"font-mono",children:m.accounts[0].accountNumber})},children:"{label} {value} \u2014 s\u1EBD \u0111\u01B0\u1EE3c d\xf9ng l\xe0m t\xe0i kho\u1EA3n ngu\u1ED3n \u1EDF b\u01B0\u1EDBc ti\u1EBFp theo."})})})]}):(0,a.jsx)("p",{className:"text-sm text-gray-700 italic",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.pressButtonHint",values:{button:(0,u.translate)({id:"newDemo.demoResult.step4Identity.buttonLabel",message:"L\u1EA5y th\xf4ng tin t\xe0i kho\u1EA3n"})},children:'Nh\u1EA5n n\xfat "{button}" \u1EDF b\xean tr\xe1i \u0111\u1EC3 th\u1EF1c hi\u1EC7n b\u01B0\u1EDBc n\xe0y.'})})})]})}let j=L[4],N="",T="GET";return"transaction"===t.scopes||"transaction"===t.id||"auto-debit"===t.id||"einvoice"===t.id?(N="/transactions",T="GET",v={fromDate:new Date(new Date().setDate(new Date().getDate()-14)).toISOString().slice(0,10),toDate:new Date().toISOString().slice(0,10)}):"qrpay"===t.scopes||"qrpay"===t.id?(N="/qr-pay",T="POST",y={amount:m?.qrPay?.amount||5e4,description:m?.qrPay?.description||"Payment description",referenceNumber:m?.qrPay?.referenceNumber||"ORDER123"}):"balance"===t.scopes||"balance-hook"===t.id||"virtual-account"===t.id?(N="/balance",T="GET"):"ekyc"===t.scopes||"ekyc"===t.id?(N="/ekyc",T="GET"):("identity"===t.scopes||"idkit"===t.id)&&(N="/identity",T="GET"),(0,a.jsx)("div",{children:p?(0,a.jsx)("div",{className:"text-center py-4",children:(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.processing",children:"\u0110ang x\u1EED l\xfd..."})})}):(0,a.jsxs)(a.Fragment,{children:[G(4,!!m),"request"===j&&N&&(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:w(T,N,o?.accessToken||null,y,v)})}),"response"===j&&(0,a.jsx)("div",{children:m?(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)(k.Z,{jsonData:(()=>
31{if("qrpay"===t.id&&m.qrUrl){let{qrUrl:e,...t}=m;return t}return m})()})}):(0,a.jsx)("p",{className:"text-sm text-gray-700 italic",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.pressButtonGeneric",children:"Nh\u1EA5n n\xfat \u1EDF b\xean tr\xe1i \u0111\u1EC3 th\u1EF1c hi\u1EC7n b\u01B0\u1EDBc n\xe0y."})})})]})});case 5:if(M){if(!m)return(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.completeTabFirst",values:{tab:(0,u.translate)({id:"newDemo.demoResult.tab4AccountRef",message:"Tab 4 (L\u1EA5y th\xf4ng tin t\xe0i kho\u1EA3n)"})},children:"Vui l\xf2ng ho\xe0n th\xe0nh {tab} tr\u01B0\u1EDBc."})});let e=L[5],n=m?.accounts?.[0]?.accountNumber||"",s="payout"===t.id?"/transfer":"/payment-initiation",r=g?.request||{..."payment-initiation"===t.id&&{referenceId:"<generated_timestamp>"},fromAccountNumber:n,toBin:"970415",toAccountNumber:"22102025",amount:11111,description:"payout"===t.id?"Chuyen tien demo Cas Link":"Lap lenh demo Cas Link"},i=D.find(e=>5===e.number),l=i?(0,x.I)(S,i.title,i.titleEn):"";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-4 p-4 bg-blue-50 border-l-4 border-blue-500 rounded",children:[(0,a.jsxs)("h4",{className:"text-sm font-bold mb-2 text-blue-900",children:[(0,a.jsx)(u.default,{id:"newDemo.demoResult.step5Label",children:"B\u01B0\u1EDBc 5:"})," ",l]}),(0,a.jsxs)("p",{className:"text-xs text-blue-800",children:[(0,a.jsx)(u.default,{id:"newDemo.demoResult.step5.description",values:{endpoint:`POST ${s}`,fromAccountNumber:(0,a.jsx)("strong",{children:"fromAccountNumber"})},children:"G\u1ECDi {endpoint} v\u1EDBi {fromAccountNumber} \u0111\xe3 l\u1EA5y \u1EDF b\u01B0\u1EDBc tr\u01B0\u1EDBc."}),"payment-initiation"===t.id&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)(u.default,{id:"newDemo.demoResult.step5.referenceIdNote",children:"Tr\u01B0\u1EDDng referenceId l\xe0 m\xe3 tham chi\u1EBFu duy nh\u1EA5t do h\u1EC7 th\u1ED1ng b\u1EA1n t\u1EA1o."})]})]})]}),b?(0,a.jsx)("div",{className:"text-center py-4",children:(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.processing",children:"\u0110ang x\u1EED l\xfd..."})})}):(0,a.jsxs)(a.Fragment,{children:[G(5,!!g),"request"===e&&(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:w("POST",s,o?.accessToken||null,r)})}),"response"===e&&(0,a.jsx)("div",{children:g?(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)(k.Z,{jsonData:g?.response??g})}):(0,a.jsx)("p",{className:"text-sm text-gray-700 italic",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.pressButtonGeneric",children:"Nh\u1EA5n n\xfat \u1EDF b\xean tr\xe1i \u0111\u1EC3 th\u1EF1c hi\u1EC7n b\u01B0\u1EDBc n\xe0y."})})})]})]})}if(!m?.qrPay)return(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.completeTabFirst",values:{tab:(0,u.translate)({id:"newDemo.demoResult.tab4QrRef",message:"Tab 4 (T\u1EA1o m\xe3 thanh to\xe1n)"})},children:"Vui l\xf2ng ho\xe0n th\xe0nh {tab} tr\u01B0\u1EDBc."})});let E=L[5];return(0,a.jsx)("div",{children:g?(0,a.jsxs)(a.Fragment,{children:[G(5,!!g),"request"===E&&(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:w("POST","/qr-pay",o?.accessToken||null,{amount:m?.qrPay?.amount||5e4,description:m?.qrPay?.description||"Payment description",referenceNumber:m?.qrPay?.referenceNumber||"ORDER123"})})}),"response"===E&&(0,a.jsxs)("div",{className:"space-y-4",children:[g.qrUrl&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-black",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.qrCodeTitle",children:"M\xe3 QR thanh to\xe1n"})}),(0,a.jsx)("div",{className:"flex justify-center bg-white border border-gray-300 rounded p-4",children:(0,a.jsx)("img",{src:g.qrUrl,alt:"VietQR Payment Code",className:"w-full max-w-[300px] h-auto border-2 border-gray-300 rounded"})}),(0,a.jsxs)("p",{className:"text-xs text-gray-600 mt-2 italic text-center",children:["\uD83D\uDCA1 ",(0,a.jsx)(u.default,{id:"newDemo.qr.scanHint",children:"Qu\xe9t m\xe3 QR \u0111\u1EC3 thanh to\xe1n"})]})]}),g.qrUrl&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-black",children:"VietQR Link"}),(0,a.jsx)("div",{className:"bg-white border border-gray-300 rounded p-3",children:(0,a.jsx)("a",{href:g.qrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 hover:text-blue-800 break-all font-mono",children:g.qrUrl})}),(0,a.jsx)("p",{className:"text-xs text-gray-600 mt-2 italic",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.clickLinkNewTab",children:"Click v\xe0o link \u0111\u1EC3 m\u1EDF trong tab m\u1EDBi"})})]})]})]}):(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)("span",{className:"animate-pulse",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.creatingVietQr",children:"\u0110ang t\u1EA1o VietQR link..."})})})});case 6:if(!g)return(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.completeTabFirst",values:{tab:(0,u.translate)({id:"newDemo.demoResult.tab5QrRef",message:"Tab 5 (Qu\xe9t m\xe3 QR)"})},children:"Vui l\xf2ng ho\xe0n th\xe0nh {tab} tr\u01B0\u1EDBc."})});let A=L[6];return(0,a.jsx)("div",{children:f?(0,a.jsxs)(a.Fragment,{children:[G(6,!!f),"request"===A&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-4 p-4 bg-blue-50 border-l-4 border-blue-500 rounded",children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-blue-900",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.webhookTitle",children:"Webhook t\u1EEB Cas \u2192 H\u1EC7 th\u1ED1ng c\u1EE7a b\u1EA1n"})}),(0,a.jsx)("p",{className:"text-xs text-blue-800",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.webhookDescription",values:{status:(0,a.jsx)("strong",{children:"HTTP 200"})},children:"Cas t\u1EF1 \u0111\u1ED9ng g\u1EEDi webhook \u0111\u1EBFn endpoint c\u1EE7a b\u1EA1n khi thanh to\xe1n th\xe0nh c\xf4ng. H\u1EC7 th\u1ED1ng c\u1EE7a b\u1EA1n c\u1EA7n response {status} \u0111\u1EC3 x\xe1c nh\u1EADn \u0111\xe3 nh\u1EADn."})})]}),(0,a.jsxs)("div",{className:"bg-white border border-gray-300 rounded p-3 mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-bold text-gray-700 mb-2",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.webhookEndpointLabel",children:"Endpoint nh\u1EADn webhook (c\u1EE7a b\u1EA1n):"})}),(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:"POST https://your-domain.com/webhook-endpoint Content-Type: application/json"})]}),(0,a.jsxs)("div",{className:"bg-white border border-gray-300 rounded p-3",children:[(0,a.jsx)("p",{className:"text-xs font-bold text-gray-700 mb-2",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.webhookRequestBodyLabel",children:"Request Body (Data t\u1EEB Cas):"})}),(0,a.jsx)(k.Z,{jsonData:f})]}),(0,a.jsxs)("p",{className:"text-xs text-gray-600 mt-3 italic",children:["\uD83D\uDCA1"," ",(0,a.jsx)(u.default,{id:"newDemo.demoResult.webhookConsoleHint",values:{console:(0,a.jsx)("a",{href:"https://console.bankhub.dev",target:"_blank",className:"text-blue-600 hover:underline",children:"Cas Console"})},children:"C\u1EA5u h\xecnh webhook endpoint t\u1EA1i {console}"})]})]}),"response"===A&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-4 p-4 bg-green-50 border-l-4 border-green-500 rounded",children:[(0,a.jsx)("h4",{className:"text-sm font-bold mb-2 text-green-900",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.webhookResponseTitle",children:"Response t\u1EEB h\u1EC7 th\u1ED1ng c\u1EE7a b\u1EA1n"})}),(0,a.jsx)("p",{className:"text-xs text-green-800",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.webhookResponseDescription",values:{retryCount:17,hours:24},children:"Khi nh\u1EADn webhook th\xe0nh c\xf4ng, h\u1EC7 th\u1ED1ng c\u1EE7a b\u1EA1n c\u1EA7n response HTTP 200. N\u1EBFu kh\xf4ng ph\u1EA3i 200 (ho\u1EB7c timeout >10s), Cas s\u1EBD g\u1EEDi l\u1EA1i webhook t\u1ED1i \u0111a {retryCount} l\u1EA7n trong {hours} gi\u1EDD."})})]}),(0,a.jsxs)("div",{className:"bg-white border border-gray-300 rounded p-3",children:[(0,a.jsx)("p",{className:"text-xs font-bold text-gray-700 mb-2",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.httpStatusLabel",children:"HTTP Status:"})}),(0,a.jsxs)("pre",{className:"text-xs font-mono text-gray-900 overflow-x-auto whitespace-pre-wrap",children:["HTTP/1.1 200 OK Content-Type: application/json","{",'"message": "Success"',"}"]})]}),(0,a.jsx)("div",{className:"mt-4 p-3 bg-yellow-50 border-l-4 border-yellow-500 rounded",children:(0,a.jsxs)("p",{className:"text-xs text-yellow-800",children:["\u26A0\uFE0F"," ",(0,a.jsx)(u.default,{id:"newDemo.demoResult.webhookRetryNote",values:{note:(0,a.jsx)("strong",{children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.note",children:"L\u01B0u \xfd:"})})},children:"{note} N\u1EBFu response kh\xe1c 200 (4XX, 5XX) ho\u1EB7c kh\xf4ng ph\u1EA3n h\u1ED3i trong 10 gi\xe2y, Cas s\u1EBD t\u1EF1 \u0111\u1ED9ng retry theo c\u01A1 ch\u1EBF Fibonacci."})]})})]})]}):(0,a.jsx)("p",{className:"text-sm text-gray-700",children:(0,a.jsx)(u.default,{id:"newDemo.demoResult.waitForCompletion",children:"Ch\u1EDD ho\xe0n th\xe0nh b\u01B0\u1EDBc n\xe0y..."})})});default:return null}})()})]})};var S=n(25108);let R=function(){let{product:e,onBack:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,r.TH)(),o=n.pathname.split("/").pop(),x=(0,d.default)("/demo"),g=e||(0,s.useMemo)(()=>{for(let e of h.Z){let t=e.products.find(e=>e.id===o);if(t)return t}return null},[o]);if(!g)return"undefined"!=typeof window&&(window.location.href=x),null;
31let[b,f]=(0,s.useState)(!1),[y,j]=(0,s.useState)(!1),[k,w]=(0,s.useState)(!1),[N,T]=(0,s.useState)(""),[R,C]=(0,s.useState)(null),[D,I]=(0,s.useState)(""),[A,L]=(0,s.useState)({}),[P,q]=(0,s.useState)(1),[O,_]=(0,s.useState)(null),[B,U]=(0,s.useState)(!1),[Z,M]=(0,s.useState)(null),[H,F]=(0,s.useState)(!1),[G,V]=(0,s.useState)(null),[Q,K]=(0,s.useState)({1:!0}),$=e=>{K(t=>({...t,[e]:!t[e]}))};(0,s.useEffect)(()=>{y&&K(e=>({...e,2:!0}))},[y]),(0,s.useEffect)(()=>{if(S.log("Step2Result changed:",O),O?.qrPay){let e=O.qrPay;S.log("QRPay data:",e),S.log("API qrUrl:",O.qrUrl);let t=O.qrUrl||"";if(!t){let n=e.bin||"",a=e.virtualAccountNumber||e.accountNumber||"",s=e.amount||"",r=e.description||e.addInfo||"";if(n&&a){t=`https://img.vietqr.io/image/${n}-${a}-compact.jpg`;let e=new URLSearchParams;s&&e.append("amount",s.toString()),r&&e.append("addInfo",r),e.toString()&&(t+=`?${e.toString()}`)}}S.log("Final VietQR URL:",t),M({qrUrl:t,qrPay:e,bank:e.bin||"",accountNo:e.virtualAccountNumber||e.accountNumber||"",amount:e.amount||"",addInfo:e.description||e.addInfo||""}),K(e=>({...e,3:!0}))}O&&(g?.id==="payout"||g?.id==="payment-initiation")&&K(e=>({...e,3:!0}))},[O]);let z=n.search,{siteConfig:{customFields:Y}}=(0,c.default)(),J="string"==typeof Y?.BANKHUB_SCRIPT_URL?Y?.BANKHUB_SCRIPT_URL:null,W="string"==typeof Y?.REDIRECT_URI?Y?.REDI
31RECT_URI:null,X="string"==typeof Y?.API_BASE_URI?Y?.API_BASE_URI:null,ee=new m.Z(X),{control:et,getValues:en,watch:ea,setValue:es}=(0,i.cI)({defaultValues:{country:g.supportedCountries[0]||"vn",accountType:g.accountTypes[0].toLowerCase()||"all",iframe:"popup"}}),er=ea("accountType"),ei=ea("country"),eo=ea("iframe"),[el,ec]=l()({src:J,checkForExisting:!0}),ed=(0,s.useMemo)(()=>new URLSearchParams(z).get("publicToken"),[z]);(0,s.useEffect)(()=>{let e=ea(()=>{j(!1),f(!1)});return()=>e.unsubscribe()},[ea]);let eu=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],I(e),ee.exchangeToken(e).then(e=>{f(!0),L(e),e.accessToken?(j(!0),localStorage.setItem("accessToken",e.accessToken),T((0,u.translate)({id:"page.Demo.result.title",message:"K\u1EBFt qu\u1EA3"})+": ")):T((0,u.translate)({id:"page.Demo.result.error.exchangeTokenProcess",message:"X\u1EA3y ra l\u1ED7i trong qu\xe1 tr\xecnh exchange token"}))})},eh={grantToken:"",redirectUri:W,iframe:"popup"===en("iframe"),official:!1,containerElement:"#cas-link-container",onSuccess:eu,onExit:()=>{}};return(0,s.useEffect)(()=>{if(ed){let e=new AbortController;return eu(ed),()=>e.abort()}T((0,u.translate)({id:"page.Demo.step-1.error.Ch\u01B0a li\xean k\u1EBFt",message:"Ch\u01B0a li\xean k\u1EBFt"}))},[ed]),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(v,{currentStep:P,isLinkedSuccess:y,productName:g.name,product:g,control:et,isLoading:k,onLinkBank:()=>{let e=en("country"),t=en("accountType");w(!0);let n="ekyc"===g.scopes?`${g.scopes}:${t}`:g.scopes;ee.createGrant(e,W,n,g.fiServiceId).then(e=>{if(w(!1),e.grantToken){C(e);let n={...eh,grantToken:e.grantToken,feature:g.feature,fiServiceType:t},{open:a}=BankHub.useBankHubLink(n);a()}})},onUpdateMode:()=>{let e=localStorage.getItem("accessToken");if(!e){S.log("Khong tim thay access token");return}ee.createUpdateMode(e,W).then(e=>{if(e.grantToken){let t={...eh,grantToken:e.grantToken},{open:n}=BankHub.useBankHubLink(t);n()}})},onBack:t,watchedValueAccountType:er,onStep2Result:e=>{if(e?.webhookData){let{webhookData:t,...n}=e;_(n),V(t)}else _(e)},onStep2Loading:U,onStep3Result:M,onStep3Loading:F,onStep4Result:V,step2Result:O,step3Result:Z,expandedSteps:Q,onToggleStep:$}),(0,a.jsx)(E,{product:g,isLinkedSuccess:y,grantTokenResult:R,publicToken:D,tokenResult:A,country:ei,accountType:er,iframe:eo,step2Result:O,step2Loading:B,step3Result:Z,step3Loading:H,step4Result:G,expandedSteps:Q,onToggleStep:$})]})}},35363:function(e,t,n){n.d(t,{Z:()=>b});var a,s,r=n("85893"),i=n("67294"),o=n("1438"),l=n("24031"),c=n("32298"),d=n("67000"),u=n("35335"),h=n("98012");function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}let p=e=>{let{title:t,titleId:n,...r}=e;return i.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:186,height:65,fill:"none",viewBox:"0 0 186 65","aria-labelledby":n},r),t?i.createElement("title",{id:n},t):null,a||(a=i.createElement("path",{fill:"#FFD369",d:"M20 16.828v14.4h16.844c.369-2.52 1.596-4.82 3.459-6.484A10.07 10.07 0 0 1 47 22.162c2.46.002 4.836.917 6.7 2.58s3.092 3.965 3.461 6.486H74v-14.4zm27 8.534c-1.91 0-3.74.786-5.091 2.186a7.6 7.6 0 0 0-2.109 5.28c0 1.98.759 3.88 2.109 5.28A7.07 7.07 0 0 0 47 40.295c.946 0 1.882-.193 2.755-.569a7.2 7.2 0 0 0 2.336-1.618 7.5 7.5 0 0 0 1.56-2.422 7.7 7.7 0 0 0 0-5.715 7.5 7.5 0 0 0-1.56-2.423 7.2 7.2 0 0 0-2.336-1.618A7 7 0 0 0 47 25.36m-27 9.066v14.4h54v-14.4H57.156c-.369 2.52-1.596 4.82-3.459 6.484A10.07 10.07 0 0 1 47 43.495a10.07 10.07 0 0 1-6.7-2.581c-1.864-1.664-3.092-3.965-3.461-6.486z"})),s||(s=i.createElement("path",{fill:"#393E46",d:"M83.547 16.828v32H76.78v-32zM97.377 48.828H86.033v-32h11.438q4.828 0 8.312 1.922 3.485 1.906 5.36 5.484 1.89 3.579 1.89 8.563 0 5-1.89 8.594-1.875 3.593-5.391 5.515-3.5 1.922-8.375 1.922m-4.578-5.797h4.297q3 0 5.047-1.062 2.063-1.078 3.093-3.328 1.047-2.266 1.047-5.844 0-3.547-1.047-5.797-1.03-2.25-3.078-3.312-2.046-1.063-5.047-1.063H92.8zM114.965 48.828v-32h6.766v14.11h.422l11.515-14.11h8.11l-11.875 14.328 12.015 17.672h-8.094l-8.765-13.156-3.328 4.062v9.094zM143.6 48.828v-24h6.656v24zm3.344-27.094q-1.485 0-2.547-.984-1.047-1-1.047-2.39 0-1.376 1.047-2.3
316 1.062-1 2.547-1 1.484 0 2.531 1 1.062.984 1.062 2.36 0 1.39-1.062 2.39-1.047.984-2.531.984M165.274 24.828v5h-14.453v-5zm-11.172-5.75h6.656v22.375q0 .922.281 1.438.281.5.782.703.515.203 1.187.203.469 0 .938-.078.468-.095.718-.14l1.047 4.952q-.5.156-1.406.36-.906.218-2.203.265-2.407.095-4.219-.64-1.797-.735-2.797-2.282-1-1.546-.984-3.906z"})))};var x=n("41205"),g=n("50502");let b=e=>{let{productId:t,className:n="w-6 h-6"}=e,a={"auto-debit":o.Z,"payment-initiation":c.Z,qrpay:l.Z,payout:c.Z,transaction:d.Z,"virtual-account":u.Z,"balance-hook":h.Z,idkit:p,einvoice:x.Z,tvan:x.Z,etax:x.Z,invoice:x.Z,ekyc:g.Z}[t]||d.Z;return(0,r.jsx)(a,{className:n})}},40254:function(e,t,n){n.d(t,{D9:function(){return l},Q5:function(){return s},Tl:function(){return a},XC:function(){return d},c5:function(){return i},pO:function(){return r},qi:function(){return o},r3:function(){return u},si:function(){return c}});let a={redirect_uri:"http://localhost:3006",iframe_uri:"https://dev.link.bankhub.dev",api_base_uri:"https://backend-merchant.bankhub.dev"},s={ALL:"all",PERSONAL:"personal",ENTERPRISE:"enterprise"},r={PERSONAL:"personal",BUSINESS:"business"},i={TRANSACTION:"transaction",ACCOUNT:"account",IDENTITY:"identity",QRPAY:"qrpay",EKYC:"ekyc",ETAX:"etax",GDT_INVOICES:"gdt_invoices",TRANSFER:"transfer",PAYMENT_INITIATION:"payment_initiation"},o={transaction:"transaction",account:"balance",identity:"identity",qrpay:"qrpay",ekyc:"ekyc"},l={ALL:"all",EKYC:"ekyc",QRPAY:"qrpay",TRANSFER:"payout",PAYMENT_INITIATION:"payment_initiation",INVOICE:"invoice"},c={vn:"vn",kh:"kh",th:"th",id:"id",my:"my"},d=["vn","kh"],u="https://casso-hq.sg.larksuite.com/scheduler/7965d133e03c886a"},46470:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(40254);let s=[{id:"payments",name:"Gi\u1EA3i ph\xe1p Thanh to\xe1n",nameEn:"Payment Solutions",description:"T\xedch h\u1EE3p c\xe1c c\u1ED5ng thanh to\xe1n \u0111a k\xeanh, x\u1EED l\xfd giao d\u1ECBch th\u1EDDi gian th\u1EF1c v\u1EDBi \u0111\u1ED9 b\u1EA3o m\u1EADt cao nh\u1EA5t.",descriptionEn:"Integrate multiple payment gateways, process real-time transactions with highest security.",icon:"\uD83D\uDCB3",products:[{id:"auto-debit",name:"Auto Debit",description:"Tr\xedch n\u1EE3 t\u1EF1 \u0111\u1ED9ng",descriptionEn:"Automatic debit",status:"Coming Soon",feature:a.D9.ALL,supportedCountries:["vn"],accountTypes:["PERSONAL","ENTERPRISE","ALL"],docPath:"/demo/auto-debit",scopes:"auto_debit",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i ng\xe2n h\xe0ng",titleEn:"Connect Bank"},{number:2,title:"Th\u1EF1c hi\u1EC7n tr\xedch n\u1EE3",titleEn:"Execute Auto Debit"}]},{id:"payment-initiation",name:"Payment Initiation",description:"API l\u1EADp l\u1EC7nh doanh nghi\u1EC7p",descriptionEn:"Enterprise payment initiation API",status:"Beta",feature:a.D9.PAYMENT_INITIATION,supportedCountries:["vn"],accountTypes:["ENTERPRISE"],docPath:"/demo/payment-initiation",scopes:"payment_initiation,identity",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i ng\xe2n h\xe0ng",titleEn:"Connect Bank"},{number:2,title:"L\u1EA5y th\xf4ng tin t\xe0i kho\u1EA3n",titleEn:"Get Account Information"},{number:3,title:"L\u1EADp l\u1EC7nh chuy\u1EC3n kho\u1EA3n",titleEn:"Create Payment Initiation"}]},{id:"qrpay",name:"QR Pay",description:"Thanh to\xe1n QR code",descriptionEn:"QR code payment",status:"Stable",feature:a.D9.QRPAY,supportedCountries:["vn","kh"],accountTypes:["PERSONAL","ENTERPRISE","ALL"],docPath:"/demo/qr-pay",scopes:"qrpay",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i ng\xe2n h\xe0ng",titleEn:"Connect Bank"},{number:2,title:"T\u1EA1o m\xe3 thanh to\xe1n",titleEn:"Create Payment Code"},{number:3,title:"Qu\xe9t m\xe3 QR",titleEn:"Scan QR Code"},{number:4,title:"Nh\u1EADn webhook",titleEn:"Receive Webhook"}]},{id:"payout",name:"Payout",description:"Chi ti\u1EC1n t\u1EF1 \u0111\u1ED9ng",descriptionEn:"Automated payout disbursement",status:"Stable",feature:a.D9.TRANSFER,supportedCountries:["vn"],accountTypes:["ALL","PERSONAL","ENTERPRISE"],docPath:"/demo/payout",scopes:"transfer,identity",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i ng\xe2n h\xe0ng",titleEn:"Connect Bank"},{number:2,title:"L\u1EA5y th\xf4ng tin t\xe0i kho\u1EA3n",titleEn:"Get Account Information"},{number:3,title:"Th\u1EF1c hi\u1EC7n chuy\u1EC3n ti\u1EC1n",titleEn:"Execute Payout"}]}]},{id:"financial-services",name:"D\u1ECBch v\u1EE5 T\xe0i ch\xednh",nameEn:"Financial Services",description:"Cung c\u1EA5p h\u1EA1 t\u1EA7ng cho ng\xe2n h\xe0ng m\u1EDF qu\u1EA3n l\xfd t\xe0i kho\u1EA3n v\xe0 b\xe1o c\xe1o t\xe0i ch\xednh t\u1EF1 \u0111\u1ED9ng",descriptionEn:"Provide open banking infrastru
31cture for account management and automated financial reporting",icon:"\uD83C\uDFE6",products:[{id:"transaction",name:"Transaction",description:"L\u1ECBch s\u1EED giao d\u1ECBch",descriptionEn:"Transaction history",status:"Stable",feature:a.D9.ALL,supportedCountries:["vn"],accountTypes:["PERSONAL","ENTERPRISE","ALL"],docPath:"/demo/transaction",scopes:"transaction",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i ng\xe2n h\xe0ng",titleEn:"Connect Bank"},{number:2,title:"Truy v\u1EA5n giao d\u1ECBch",titleEn:"Query Transactions"}]},{id:"virtual-account",name:"Virtual Account",description:"T\xe0i kho\u1EA3n \u1EA3o",descriptionEn:"Virtual account",status:"Stable",feature:a.D9.ALL,supportedCountries:["vn"],accountTypes:["ENTERPRISE"],docPath:"/demo/virtual-account",scopes:"virtual_account",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i ng\xe2n h\xe0ng",titleEn:"Connect Bank"},{number:2,title:"T\u1EA1o t\xe0i kho\u1EA3n \u1EA3o",titleEn:"Create Virtual Account"}]},{id:"balance-hook",name:"Balance Hook",description:"Webhook s\u1ED1 d\u01B0",descriptionEn:"Balance webhook",status:"Beta",feature:a.D9.ALL,supportedCountries:["vn"],accountTypes:["PERSONAL","ENTERPRISE","ALL"],docPath:"/demo/balance-hook",scopes:"qrpay",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i ng\xe2n h\xe0ng",titleEn:"Connect Bank"},{number:2,title:"\u0110\u0103ng k\xfd webhook",titleEn:"Register Webhook"}]}]},{id:"gdt-hub",name:"GDT Hub",nameEn:"GDT Hub",description:"Trung t\xe2m k\u1EBFt n\u1ED1i d\u1EEF li\u1EC7u ch\xednh ph\u1EE7 v\xe0 c\xe1c d\u1ECBch v\u1EE5 c\xf4ng \xedch cho doanh nghi\u1EC7p fintech",descriptionEn:"Government data connectivity hub and public services for fintech businesses",icon:"\uD83D\uDD17",products:[{id:"etax",name:"Etax",description:"K\u1EBFt n\u1ED1i h\u1EC7 th\u1ED1ng thu\u1EBF \u0111i\u1EC7n t\u1EED",descriptionEn:"Electronic tax system integration",status:"Beta",feature:a.D9.ALL,supportedCountries:["vn"],accountTypes:["ENTERPRISE"],docPath:"#",scopes:"gdt:etax",fiServiceId:"847ea158-0e64-4c65-bac3-3827e87f6e3d",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i Thu\u1EBF \u0111i\u1EC7n t\u1EED",titleEn:"Connect E-Tax"},{number:2,title:"Truy v\u1EA5n th\xf4ng tin thu\u1EBF",titleEn:"Query Tax Information"}]},{id:"invoice",name:"Invoice",description:"Qu\u1EA3n l\xfd h\xf3a \u0111\u01A1n",descriptionEn:"Invoice management",status:"Beta",feature:a.D9.ALL,supportedCountries:["vn"],accountTypes:["ENTERPRISE"],docPath:"#",scopes:"gdt:invoice",fiServiceId:"9fd49a0b-a9f0-4eb5-8c10-00c23bd29a41",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i Ho\xe1 \u0111\u01A1n \u0111i\u1EC7n t\u1EED",titleEn:"Connect E-Invoice GDT"},{number:2,title:"Qu\u1EA3n l\xfd h\xf3a \u0111\u01A1n",titleEn:"Manage Invoices"}]}]},{id:"invoice-hub",name:"Invoice Hub",nameEn:"Invoice Hub",description:"Qu\u1EA3n l\xfd v\xe0 x\u1EED l\xfd h\xf3a \u0111\u01A1n \u0111i\u1EC7n t\u1EED, k\u1EBFt n\u1ED1i v\u1EDBi h\u1EC7 th\u1ED1ng thu\u1EBF v\xe0 TVAN",descriptionEn:"Manage and process electronic invoices, connect with tax system and TVAN",icon:"\uD83D\uDCC4",products:[{id:"einvoice",name:"E-Invoice",description:"H\xf3a \u0111\u01A1n \u0111i\u1EC7n t\u1EED",descriptionEn:"Electronic invoice",status:"Alpha",feature:a.D9.INVOICE,supportedCountries:["vn"],accountTypes:["ENTERPRISE"],docPath:"/demo/e-invoice",scopes:"invoice",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i ho\xe1 \u0111\u01A1n \u0111i\u1EC7n t\u1EF1",titleEn:"Connect E Invoice"},{number:2,title:"Truy v\u1EA5n h\xf3a \u0111\u01A1n",titleEn:"Query Invoice"}]},{id:"tvan",name:"TVAN",description:"G\u1EEDi th\xf4ng \u0111i\u1EC7p h\xf3a \u0111\u01A1n \u0111i\u1EC7n t\u1EED t\u1EDBi h\u1EC7 th\u1ED1ng TVAN",descriptionEn:"Send electronic invoice messages to TVAN system",status:"Beta",feature:a.D9.ALL,supportedCountries:["vn"],accountTypes:["ENTERPRISE"],docPath:"/demo/tvan",scopes:"invoice",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i TVAN",titleEn:"Connect TVAN"},{number:2,title:"G\u1EEDi th\xf4ng \u0111i\u1EC7p",titleEn:"Send Message"}]}]},{id:"onboarding-identity",name:"Onboarding v\xe0 Identity",nameEn:"Onboarding & Identity",description:"S\u1ED1 h\xf3a quy tr\xecnh \u0111\u1ECBnh danh kh\xe1ch h\xe0ng eKYC v\xe0 k\xedch ho\u1EA1t d\u1ECBch v\u1EE5 ch\u1EC9 trong v\xe0i gi\xe2y",descriptionEn:"Digitize customer eKYC identification process and activate services in seconds",icon:"\uD83D\uDD10",products:[{id:"ekyc",name:"eKYC",description:"X\xe1c th\u1EF1c danh t\xednh \u0111i\u1EC7n t\u1EED",descriptionEn:"Electronic KYC",status:"Stable",feature:a.D9.EKYC,supportedCountries:["vn"],accountTypes:["PE
31RSONAL","BUSINESS"],docPath:"/demo/ekyc",scopes:"ekyc",integrationSteps:[{number:1,title:"K\u1EBFt n\u1ED1i ng\xe2n h\xe0ng",titleEn:"Connect Bank"},{number:2,title:"Truy v\u1EA5n eKYC",titleEn:"Query eKYC"}]}]}]},61167:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(40254);let s=class{baseUrl;constructor(e){this.baseUrl=e||a.Tl.api_base_uri}async fetchPost(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(await fetch(this.baseUrl+e,{method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify(t)})).json()}async fetchGet(e,t){return(await fetch(this.baseUrl+e,{method:"GET",headers:t})).json()}async createGrant(e,t,n,a){let s={redirectUri:t,scopes:n,language:"vi",country:e};return a&&(s.fiServiceId=a),await this.fetchPost("/credential/grant",s)}async createUpdateMode(e,t){return await this.fetchPost("/credential/grant/update",{redirectUri:t,scopes:"transaction,identity,balance,qrpay",language:"vi"},{Authorization:e})}async exchangeToken(e){return await this.fetchPost("/credential/exchangeToken",{publicToken:e})}async getTransactions(e,t,n){let a=`/resource/transaction?fromDate=${t}&toDate=${n}`;return await this.fetchGet(a,{Authorization:e})}async getBalance(e){return await this.fetchGet("/resource/balance",{Authorization:e})}async getIdentity(e){return await this.fetchGet("/resource/identity",{Authorization:e})}async getQRPay(e){return await this.fetchGet("/resource/qr-pay",{Authorization:e})}async getEkyc(e){return await this.fetchGet("/resource/ekyc",{Authorization:e})}async getFinancialStatements(e,t,n){let a=`/resource/gdt/financial-statements?fromYear=${t}&toYear=${n}`;return await this.fetchGet(a,{Authorization:e})}async getGdtInvoices(e,t,n){let a=`/resource/gdt/invoices?fromDate=${t}&toDate=${n}`;return await this.fetchGet(a,{Authorization:e})}async check(e){let t=`/notify/check?referenceNumber=${e}`;return await this.fetchGet(t,{})}async transfer(e,t){return await this.fetchPost("/resource/transfer",t,{Authorization:e})}async paymentInitiation(e,t){return await this.fetchPost("/resource/payment-initiation",t,{Authorization:e})}}},6895:function(e,t,n){n.d(t,{I:function(){return a}});let a=(e,t,n)=>"en"===e&&n?n:t}}]);
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.