From 1e1d2b5053750e257d914ba5ebce5e2bd474da59 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Mon, 19 Feb 2024 13:05:56 +0800 Subject: [PATCH] set 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 17cefe5..ac6d04e 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 f3b2c74..72b93a8 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"), }); };