Explorar el Código

update download btn

master
Alex Cheung hace 1 año
padre
commit
9c2b2bc6e5
Se han modificado 2 ficheros con 18 adiciones y 1 borrados
  1. +9
    -1
      src/pages/Payment/FPS/AckPage.js
  2. +9
    -0
      src/pages/Payment/PaymentCallback.js

+ 9
- 1
src/pages/Payment/FPS/AckPage.js Ver fichero

@@ -51,7 +51,7 @@ const AckPage = () => {
// const [transactionTime, setTransactionTime] = React.useState("");
const [onReady, setOnReady] = React.useState(false);
const paymentStatusApi = "/api/payment/status/";
const [onDownload, setOnDownload] = React.useState(false);

React.useEffect(() => {
loadForm();
@@ -142,8 +142,15 @@ const AckPage = () => {

const doPrint = () => {
// window.print();
setOnDownload(true)
HttpUtils.fileDownload({
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId"),
onResponse:()=>{
setOnDownload(false)
},
onError:()=>{
setOnDownload(false)
}
});
};

@@ -182,6 +189,7 @@ const AckPage = () => {
<PaymentDetails
formData={paymentData}
doPrint={doPrint}
onDownload={onDownload}
style={{
display: "flex",
height: "100%",


+ 9
- 0
src/pages/Payment/PaymentCallback.js Ver fichero

@@ -40,6 +40,7 @@ const Index = () => {
const [paymentData, setPaymentData] = React.useState({});
const [itemList, setItemList] = React.useState([]);
// const [paymentId, setPaymentId] = React.useState("");
const [onDownload, setOnDownload] = React.useState(false);

const [transactionData, setTransactionData] = React.useState({});
// const [transactionDate, setTransactionDate] = React.useState("");
@@ -144,8 +145,15 @@ const Index = () => {

const doPrint = () => {
// window.print();
setOnDownload(true)
HttpUtils.fileDownload({
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId"),
onResponse:()=>{
setOnDownload(false)
},
onError:()=>{
setOnDownload(false)
}
});
};

@@ -184,6 +192,7 @@ const Index = () => {
<PaymentDetails
formData={paymentData}
doPrint={doPrint}
onDownload={onDownload}
style={{
display: "flex",
height: "100%",


Cargando…
Cancelar
Guardar