From 7181266b46af1965429302ea9aa9cb1b691f1d55 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Mon, 19 Feb 2024 13:08:04 +0800 Subject: [PATCH] fix download recipt --- src/pages/Payment/FPS/AckPage.js | 8 ++++---- src/pages/Payment/PaymentCallback.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/Payment/FPS/AckPage.js b/src/pages/Payment/FPS/AckPage.js index 6281fb8..7c1d020 100644 --- a/src/pages/Payment/FPS/AckPage.js +++ b/src/pages/Payment/FPS/AckPage.js @@ -44,7 +44,7 @@ const AckPage = () => { const [paymentData, setPaymentData] = React.useState({}); const [responeData, setResponeDataData] = React.useState({}); const [itemList, setItemList] = React.useState([]); - const [paymentId, setPaymentId] = React.useState(""); + // const [paymentId, setPaymentId] = React.useState(""); const [transactionData, setTransactionData] = React.useState({}); // const [transactionDate, setTransactionDate] = React.useState(""); @@ -110,8 +110,8 @@ const AckPage = () => { responseData2.data["transTimeStr"] = DateUtils.dateFormat(responseData2.data.transDateTime, "HH:mm:ss"); setItemList(responseData2.paymentItemList) setPaymentData(responseData2.data); - localStorage.removeItem("paymentId"); - setPaymentId(responseData2.id) + // localStorage.removeItem("paymentId"); + // setPaymentId(responseData2.id) } }); } @@ -143,7 +143,7 @@ const AckPage = () => { const doPrint = () => { // window.print(); HttpUtils.fileDownload({ - url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+paymentId, + url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId"), }); }; diff --git a/src/pages/Payment/PaymentCallback.js b/src/pages/Payment/PaymentCallback.js index 283297a..006a4e6 100644 --- a/src/pages/Payment/PaymentCallback.js +++ b/src/pages/Payment/PaymentCallback.js @@ -39,7 +39,7 @@ const Index = () => { const [paymentData, setPaymentData] = React.useState({}); const [itemList, setItemList] = React.useState([]); - const [paymentId, setPaymentId] = React.useState(""); + // const [paymentId, setPaymentId] = React.useState(""); const [transactionData, setTransactionData] = React.useState({}); // const [transactionDate, setTransactionDate] = React.useState(""); @@ -132,8 +132,8 @@ const Index = () => { responseData2.data["transTimeStr"] = DateUtils.dateFormat(responseData2.data.transDateTime, "HH:mm:ss"); setItemList(responseData2.paymentItemList) setPaymentData(responseData2.data); - localStorage.removeItem("paymentId"); - setPaymentId(responseData2.id) + // localStorage.removeItem("paymentId"); + // setPaymentId(responseData2.id) } }); } @@ -145,7 +145,7 @@ const Index = () => { const doPrint = () => { // window.print(); HttpUtils.fileDownload({ - url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+paymentId, + url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId"), }); };