| @@ -52,22 +52,18 @@ const Index = () => { | |||||
| // const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/"; | // const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/"; | ||||
| // const receiverUrl = "/noti-api/payment/payment-notification"; | // const receiverUrl = "/noti-api/payment/payment-notification"; | ||||
| //timer | |||||
| const currentTimer = React.useRef(); | |||||
| const [time, setTime] = React.useState(0); | |||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| if (location.state != undefined) { | if (location.state != undefined) { | ||||
| setPaymentData(location.state) | setPaymentData(location.state) | ||||
| } | } | ||||
| loadForm(); | |||||
| currentTimer.current = setInterval(() => { | |||||
| getPaymentStatus(); | |||||
| setTime((prevTime) => prevTime + 1); | |||||
| }, 500); | |||||
| return () => clearInterval(currentTimer.current); | |||||
| }, []); | }, []); | ||||
| React.useEffect(() => { | |||||
| if (Object.keys(paymentData).length > 0){ | |||||
| loadForm(); | |||||
| } | |||||
| }, [paymentData]); | |||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| setOnReady(true); | setOnReady(true); | ||||
| }, [redirecturl]); | }, [redirecturl]); | ||||
| @@ -115,32 +111,6 @@ const Index = () => { | |||||
| }); | }); | ||||
| } | } | ||||
| const getPaymentStatus = () => { | |||||
| // HttpUtils.post({ | |||||
| // url: paymentPath+paymentStatusApi+paymentid, | |||||
| // params:{ | |||||
| // "apprefid": paymentData.transactionid, | |||||
| // "webtoken": paymentData.webtoken, | |||||
| // }, | |||||
| // onSuccess: function(responseData){ | |||||
| // const paymentstatuscode = responseData.paymentdetail.result.paymentstatuscode; | |||||
| // if (paymentstatuscode === 'APPR') { | |||||
| // const timestamp = '?t=' + Date.now(); | |||||
| // window.top.location.href = paymentPath + payment.config.ackPagePath + timestamp; | |||||
| // } else if (paymentstatuscode === 'CANC') { | |||||
| // window.top.location.href = paymentPath + payment.config.indexPagePath; | |||||
| // } else { | |||||
| // window.top.location.href = paymentPath + payment.config.errPagePath; | |||||
| // } | |||||
| // }, | |||||
| // onError: function(){ | |||||
| // cancelPayment() | |||||
| // clearInterval(currentTimer.current); | |||||
| // } | |||||
| // }); | |||||
| }; | |||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| const timeOutDate = new Date(fpsmerchanttimeoutdatetime); | const timeOutDate = new Date(fpsmerchanttimeoutdatetime); | ||||
| const currentTime = new Date; | const currentTime = new Date; | ||||
| @@ -164,34 +134,6 @@ const Index = () => { | |||||
| }); | }); | ||||
| } | } | ||||
| // const getPayload = ()=>{ | |||||
| // HttpUtils.get({ | |||||
| // url: payloadUrl+"<paymenttoken>", | |||||
| // onSuccess: function(responseData){ | |||||
| // /* | |||||
| // { | |||||
| // "payload": "<payload>" | |||||
| // } | |||||
| // */ | |||||
| // } | |||||
| // }); | |||||
| // } | |||||
| // const getReceiver = ()=>{ | |||||
| // HttpUtils.get({ | |||||
| // url: receiverUrl+"<paymenttoken>", | |||||
| // onSuccess: function(responseData){ | |||||
| // /* | |||||
| // { | |||||
| // "payload": "<payload>" | |||||
| // } | |||||
| // */ | |||||
| // } | |||||
| // }); | |||||
| // } | |||||
| const getIcon = () => { | const getIcon = () => { | ||||
| if(paymentData.type=="Visa") return VisaIcon; | if(paymentData.type=="Visa") return VisaIcon; | ||||
| if(paymentData.type=="Mastercard") return MasterIcon; | if(paymentData.type=="Mastercard") return MasterIcon; | ||||