@@ -12,7 +12,7 @@ import * as HttpUtils from "utils/HttpUtils"; | |||
import * as UrlUtils from "utils/ApiPathConst"; | |||
// import { useNavigate } from "react-router-dom"; | |||
// import FpsIcon from "assets/images/icons/fps.svg"; | |||
// import { useLocation } from 'react-router-dom'; | |||
import { useLocation } from 'react-router-dom'; | |||
// import {paymentPath} from "auth/utils"; | |||
// import {poll} from "utils/Utils"; | |||
import * as DateUtils from "utils/DateUtils" | |||
@@ -38,10 +38,11 @@ const BackgroundHead = { | |||
const AckPage = () => { | |||
// const navigate = useNavigate() | |||
// const location = useLocation(); | |||
const location = useLocation(); | |||
// const [locationData, setLocationData] = React.useState({}); | |||
const [paymentData, setPaymentData] = React.useState({}); | |||
const [locationData, setLocationData] = React.useState({}); | |||
const [responeData, setResponeDataData] = React.useState({}); | |||
const [itemList, setItemList] = React.useState([]); | |||
// const [paymentId, setPaymentId] = React.useState(""); | |||
@@ -56,7 +57,10 @@ const AckPage = () => { | |||
const { locale } = intl; | |||
React.useEffect(() => { | |||
loadForm(); | |||
if (location.state != undefined) { | |||
setLocationData(location.state) | |||
loadForm(); | |||
} | |||
}, []); | |||
React.useEffect(() => { | |||
@@ -81,15 +85,15 @@ const AckPage = () => { | |||
// const trnTime = date.getHours()+":"+date.getMinutes()+":"+date.getSeconds(); | |||
// setTransactionDate(trnDate) | |||
// setTransactionTime(trnTime) | |||
let transactionid = localStorage.getItem("transactionid") | |||
let webtoken = localStorage.getItem("webtoken") | |||
// let transactionid = localStorage.getItem("transactionid") | |||
// let webtoken = localStorage.getItem("webtoken") | |||
let transactionid = locationData.transactionid | |||
HttpUtils.post({ | |||
url: UrlUtils.PAYMENT_CALLBACK_STATUS_API, | |||
params:{ | |||
"apprefid": transactionid, | |||
"webtoken": webtoken, | |||
"paymentId": localStorage.getItem("paymentId"), | |||
// "webtoken": webtoken, | |||
// "paymentId": localStorage.getItem("paymentId"), | |||
"transactionid":Number(transactionid) | |||
}, | |||
onSuccess: function(responseData){ | |||
@@ -155,7 +159,8 @@ const AckPage = () => { | |||
setOnDownload(true) | |||
const local = locale | |||
HttpUtils.fileDownload({ | |||
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId")+"/"+local, | |||
// url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId")+"/"+local, | |||
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+paymentData.data.id+"/"+local, | |||
onResponse:()=>{ | |||
setOnDownload(false) | |||
}, | |||
@@ -115,7 +115,7 @@ const Index = () => { | |||
}, [fpsTransctionData]); | |||
const loadForm = () => { | |||
const loadForm = () => () =>{ | |||
// const timeoutdatetime = "2023-10-26T09:04:30Z[UTC]" | |||
// const convertedDateString = timeoutdatetime.replace("[UTC]", ""); | |||
// setFpsmerchanttimeoutdatetime(convertedDateString) | |||
@@ -134,8 +134,8 @@ const Index = () => { | |||
HttpUtils.post({ | |||
url: UrlUtils.LOAD_PAYMENT_FPS_URL, | |||
params:{ | |||
// "transactionid": transactionid, | |||
// "webtoken": webtoken, | |||
"transactionid": transactionid, | |||
"webtoken": webtoken, | |||
"paymentmethod":"04,BCFP,FPS", | |||
"order": { | |||
"totalamount":paymentData.amount, | |||
@@ -208,10 +208,14 @@ const Index = () => { | |||
if (paymentstatuscode != "" && paymentstatuscode != "INPR" ){ | |||
if (paymentstatuscode === 'APPR') { | |||
// const timestamp = Date.now(); | |||
navigate('/paymentPage/fps/ackpage'); | |||
let page = '/paymentPage/fps/ackpage'; | |||
let stateParams = { state: { transactionid: paymentData.transactionid} } | |||
navigate(page, stateParams); | |||
} else if (paymentstatuscode === 'CANC') { | |||
// const timestamp = Date.now(); | |||
navigate('/paymentPage/fps/ackpage'); | |||
let page = '/paymentPage/fps/ackpage'; | |||
let stateParams = { state: { transactionid: paymentData.transactionid} } | |||
navigate(page, stateParams); | |||
} else { | |||
// window.top.location.href = paymentPath + payment.config.errPagePath; | |||
alert("ERROR") | |||
@@ -216,7 +216,9 @@ const MultiPaymentWindow = (props) => { | |||
}); | |||
const latestDataObjects = Object.values(latestData); | |||
const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); | |||
// const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); | |||
const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status == "CANC" || item.status == "REJT"); | |||
const filteredAppIds = filteredData.map(item => item.appId); | |||
const appIdsNotInData = appIdList.filter(appId => !latestDataObjects.some(item => item.appId === appId)); | |||
@@ -114,8 +114,8 @@ const Index = () => { | |||
url: UrlUtils.PAYMENT_CALLBACK_STATUS_API, | |||
params: { | |||
"apprefid": transactionid, | |||
"webtoken": localStorage.getItem("webtoken"), | |||
"paymentId": localStorage.getItem("paymentId"), | |||
// "webtoken": localStorage.getItem("webtoken"), | |||
// "paymentId": localStorage.getItem("paymentId"), | |||
"transactionid":Number(transactionid) | |||
}, | |||
onSuccess: function (responseData) { | |||
@@ -162,7 +162,8 @@ const Index = () => { | |||
const local = locale | |||
// console.log(local) | |||
HttpUtils.fileDownload({ | |||
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId")+"/"+local, | |||
// url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId")+"/"+local, | |||
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+paymentData.data.id+"/"+local, | |||
onResponse:()=>{ | |||
setOnDownload(false) | |||
}, | |||
@@ -100,7 +100,9 @@ const Index = () => { | |||
}); | |||
const latestDataObjects = Object.values(latestData); | |||
const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); | |||
// const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); | |||
const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status == "CANC" || item.status == "REJT"); | |||
const filteredAppIds = filteredData.map(item => item.appId); | |||
const appIdsNotInData = appIdList.filter(appId => !latestDataObjects.some(item => item.appId === appId)); | |||
@@ -149,7 +149,9 @@ const ApplicationDetailCard = ( | |||
}); | |||
const latestDataObjects = Object.values(latestData); | |||
const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); | |||
// const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); | |||
const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status == "CANC" || item.status == "REJT"); | |||
const filteredAppIds = filteredData.map(item => item.appId); | |||
const appIdsNotInData = appIdList.filter(appId => !latestDataObjects.some(item => item.appId === appId)); | |||
@@ -131,6 +131,7 @@ export default function SubmittedTab({ rows }) { | |||
const latestData = {}; | |||
responseData.forEach(item => { | |||
console.log(item) | |||
const { appId, timeDiff } = item; | |||
if (latestData[appId] === undefined || timeDiff < latestData[appId].timeDiff) { | |||
latestData[appId] = item; | |||
@@ -138,7 +139,7 @@ export default function SubmittedTab({ rows }) { | |||
}); | |||
const latestDataObjects = Object.values(latestData); | |||
const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR"); | |||
const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status == "CANC" || item.status == "REJT"); | |||
const filteredAppIds = filteredData.map(item => item.appId); | |||
const appIdsNotInData = appIdList.filter(appId => !latestDataObjects.some(item => item.appId === appId)); | |||