Browse Source

update fps expired

CR003
Alex Cheung 9 months ago
parent
commit
71541441a5
8 changed files with 46 additions and 12 deletions
  1. BIN
      src/assets/images/icons/expiredQrcode.png
  2. BIN
      src/assets/images/icons/expiredQrcodeCN.png
  3. BIN
      src/assets/images/icons/expiredQrcodeEN.png
  4. BIN
      src/assets/images/icons/expiredQrcodeZH.png
  5. +40
    -12
      src/pages/Payment/FPS/FPS.js
  6. +2
    -0
      src/translations/en.json
  7. +2
    -0
      src/translations/zh-CN.json
  8. +2
    -0
      src/translations/zh-HK.json

BIN
src/assets/images/icons/expiredQrcode.png View File

Before After
Width: 300  |  Height: 300  |  Size: 8.6 KiB

BIN
src/assets/images/icons/expiredQrcodeCN.png View File

Before After
Width: 300  |  Height: 300  |  Size: 6.8 KiB

BIN
src/assets/images/icons/expiredQrcodeEN.png View File

Before After
Width: 300  |  Height: 300  |  Size: 8.8 KiB

BIN
src/assets/images/icons/expiredQrcodeZH.png View File

Before After
Width: 300  |  Height: 300  |  Size: 6.9 KiB

+ 40
- 12
src/pages/Payment/FPS/FPS.js View File

@@ -10,7 +10,9 @@ import * as HttpUtils from "utils/HttpUtils";
import * as UrlUtils from "utils/ApiPathConst"; import * as UrlUtils from "utils/ApiPathConst";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import FpsIcon from "assets/images/icons/fps.svg"; import FpsIcon from "assets/images/icons/fps.svg";
import expiredQrcode from "assets/images/icons/expiredQrcode.png";
import expiredQrcodeEN from "assets/images/icons/expiredQrcodeEN.png";
import expiredQrcodeZH from "assets/images/icons/expiredQrcodeZH.png";
import expiredQrcodeCN from "assets/images/icons/expiredQrcodeCN.png";
import { useLocation } from 'react-router-dom'; import { useLocation } from 'react-router-dom';
// import {paymentPath} from "auth/utils"; // import {paymentPath} from "auth/utils";
import {currencyFormat} from "utils/FormatUtils"; import {currencyFormat} from "utils/FormatUtils";
@@ -20,7 +22,7 @@ import Loadable from 'components/Loadable';
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));


import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import {FormattedMessage} from "react-intl";
import {FormattedMessage, useIntl} from "react-intl";
const BackgroundHead = { const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`, backgroundImage: `url(${titleBackgroundImg})`,
width: '100%', width: '100%',
@@ -37,12 +39,15 @@ const BackgroundHead = {
const Index = () => { const Index = () => {
const navigate = useNavigate() const navigate = useNavigate()
const location = useLocation(); const location = useLocation();
const intl = useIntl();
const { locale } = intl;


const [locationData, setLocationData] = React.useState({}); const [locationData, setLocationData] = React.useState({});
const [paymentData, setPaymentData] = React.useState({}); const [paymentData, setPaymentData] = React.useState({});
const [onReady, setOnReady] = React.useState(false); const [onReady, setOnReady] = React.useState(false);
const [qrCodeTimeout, setqrCodeTimeout] = React.useState(false); const [qrCodeTimeout, setqrCodeTimeout] = React.useState(false);
const [paymentStatusCode, setPaymentStatusCode] = React.useState(""); const [paymentStatusCode, setPaymentStatusCode] = React.useState("");
const [expiredQrcode, setExpiredQrcode] = React.useState(expiredQrcodeEN);
const [responeData, setResponeDataData] = React.useState({}); const [responeData, setResponeDataData] = React.useState({});
const [fpsTransctionData, setFpsTransctionData] = React.useState({}); const [fpsTransctionData, setFpsTransctionData] = React.useState({});
@@ -101,6 +106,17 @@ const Index = () => {
} }
}, [locationData]); }, [locationData]);


React.useEffect(() => {
// console.log (locationData)
if (locale === 'zh-HK'){
setExpiredQrcode(expiredQrcodeZH)
} else if (locale === 'en'){
setExpiredQrcode(expiredQrcodeEN)
} else {
setExpiredQrcode(expiredQrcodeCN)
}
}, [locale]);

React.useEffect(() => { React.useEffect(() => {
// console.log (paymentData) // console.log (paymentData)
if (Object.keys(paymentData).length > 0){ if (Object.keys(paymentData).length > 0){
@@ -202,7 +218,7 @@ const Index = () => {
}); });


//testing //testing
// const timeoutdatetime = "2024-05-06T11:10:30Z[UTC]"
// const timeoutdatetime = "2024-11-18T07:04:35Z[UTC]"
// const convertedDateString = timeoutdatetime.replace("[UTC]", ""); // const convertedDateString = timeoutdatetime.replace("[UTC]", "");
// setFpsmerchanttimeoutdatetime(convertedDateString) // setFpsmerchanttimeoutdatetime(convertedDateString)
// setPaymentId("C202310268000681") // setPaymentId("C202310268000681")
@@ -210,7 +226,7 @@ const Index = () => {
// { // {
// "paymentid": "C202310268000681", // "paymentid": "C202310268000681",
// "paymentstatus": "INPR", // "paymentstatus": "INPR",
// "fpsmerchanttimeoutdatetime": "2024-05-06T11:10:30Z[UTC]",
// "fpsmerchanttimeoutdatetime": "2024-11-18T07:04:35Z[UTC]",
// "fpsqrcodeimgbase64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAuyklEQVR4Xu3dfcy/d1nff2IAAAAASUVORK5CYII=", // "fpsqrcodeimgbase64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAuyklEQVR4Xu3dfcy/d1nff2IAAAAASUVORK5CYII=",
// "fpsqrcodeurl": "http://127.0.0.1:8080/api/payment/wallet/fps/enquiryfpspayload/vm.JKDDlTOavR3ASviSwUnS1Lw4-" // "fpsqrcodeurl": "http://127.0.0.1:8080/api/payment/wallet/fps/enquiryfpspayload/vm.JKDDlTOavR3ASviSwUnS1Lw4-"
// } // }
@@ -275,17 +291,20 @@ const Index = () => {
const timeOutDate = new Date(fpsmerchanttimeoutdatetime); const timeOutDate = new Date(fpsmerchanttimeoutdatetime);
const currentTime = new Date; const currentTime = new Date;
const timedowncount = Math.round((timeOutDate.getTime() - currentTime.getTime()) / 1000); const timedowncount = Math.round((timeOutDate.getTime() - currentTime.getTime()) / 1000);
setTimeDownCount(timedowncount);
// console.log(time) // console.log(time)
// console.log(timeOutDate) // console.log(timeOutDate)
// console.log(currentTime) // console.log(currentTime)
// console.log(timeOutDate.getTime()-currentTime.getTime()) // console.log(timeOutDate.getTime()-currentTime.getTime())
getPaymentStatus(); getPaymentStatus();

if (timeOutDate.getTime()<currentTime.getTime()){ if (timeOutDate.getTime()<currentTime.getTime()){
// console.log("stop"); // console.log("stop");
clearInterval(currentTimer.current); clearInterval(currentTimer.current);
setqrCodeTimeout(true) setqrCodeTimeout(true)
setTimeDownCount(0);
// cancelPayment() // cancelPayment()
}else{
setTimeDownCount(timedowncount);
} }
},[time]) },[time])


@@ -349,6 +368,8 @@ const Index = () => {
<Grid item xs={12} md={12} > <Grid item xs={12} md={12} >


<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}> <Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
<FormattedMessage id="payAlert"/>
<br /><br />
<img src={FpsIcon} width="80" height="80" alt="FPS"></img> <img src={FpsIcon} width="80" height="80" alt="FPS"></img>
<br /> <br />
<FormattedMessage id="payTotalDeatail"/> <FormattedMessage id="payTotalDeatail"/>
@@ -406,13 +427,20 @@ const Index = () => {
<br /> <br />
{"["+paymentId+"]"} {"["+paymentId+"]"}
<br/> <br/>
<FormattedMessage id="fpsQrcodeTitle2"/>
<br />
<FormattedMessage id="fpsQrcodeTitle3"/>
<br />
<FormattedMessage id="fpsQrcodeTitle4"/>&nbsp;
{timeDownCount}&nbsp;
<FormattedMessage id="fpsQrcodeTitle5"/>
{
timeDownCount<=0?
<FormattedMessage id="fpsQrcodeExpired"/>:
<>
<FormattedMessage id="fpsQrcodeTitle2"/>
<br />
<FormattedMessage id="fpsQrcodeTitle3"/>
<br />
<FormattedMessage id="fpsQrcodeTitle4"/>&nbsp;
{timeDownCount}&nbsp;
<FormattedMessage id="fpsQrcodeTitle5"/>
</>
}
</Typography> </Typography>
} }
<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}> <Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>


+ 2
- 0
src/translations/en.json View File

@@ -384,6 +384,7 @@
"payId": "Payment No.", "payId": "Payment No.",
"payConfirm": "Confirm payment", "payConfirm": "Confirm payment",
"payCancel": "Cancel payment", "payCancel": "Cancel payment",
"payAlert": "Please don’t close this window, you may either complete this payment or cancel this payment by the button at the bottom of this page.",
"payTotalDeatail": "Total Payment Amount", "payTotalDeatail": "Total Payment Amount",
"payDeatail": "Total Payment Amount", "payDeatail": "Total Payment Amount",
"payTotal": "Total Payment Amount", "payTotal": "Total Payment Amount",
@@ -478,6 +479,7 @@
"fpsQrcodeTitle3":"Please complete the payment process within the specified time", "fpsQrcodeTitle3":"Please complete the payment process within the specified time",
"fpsQrcodeTitle4":"Remaining time:", "fpsQrcodeTitle4":"Remaining time:",
"fpsQrcodeTitle5":"s", "fpsQrcodeTitle5":"s",
"fpsQrcodeExpired":"QR code has expired.",


"payDnRemark": "Payment proof (e.g. ATM receipt, internet banking record) to be sent to [email protected] by {date} 12:30 p.m.", "payDnRemark": "Payment proof (e.g. ATM receipt, internet banking record) to be sent to [email protected] by {date} 12:30 p.m.",
"payNPGORemark" :"Payment to be completed at NPGO Collection Office by {date} 12:30 p.m.", "payNPGORemark" :"Payment to be completed at NPGO Collection Office by {date} 12:30 p.m.",


+ 2
- 0
src/translations/zh-CN.json View File

@@ -77,6 +77,7 @@
"fpsQrcodeTitle3":"请在规定时间内完成付款流程", "fpsQrcodeTitle3":"请在规定时间内完成付款流程",
"fpsQrcodeTitle4":"剩余时间:", "fpsQrcodeTitle4":"剩余时间:",
"fpsQrcodeTitle5":"秒", "fpsQrcodeTitle5":"秒",
"fpsQrcodeExpired":"二维码已过期",
"payDnRemark": "在{date}下午12时30分前将付款证明(例如银行入数纸或网上银行付款记录)电邮至 [email protected]", "payDnRemark": "在{date}下午12时30分前将付款证明(例如银行入数纸或网上银行付款记录)电邮至 [email protected]",
"payNPGORemark" :"在{date}下午12时30分前到北角政府合署收款处完成付款", "payNPGORemark" :"在{date}下午12时30分前到北角政府合署收款处完成付款",
@@ -416,6 +417,7 @@
"payId": "付款编号", "payId": "付款编号",
"payConfirm": "确认付款", "payConfirm": "确认付款",
"payCancel": "取消付款", "payCancel": "取消付款",
"payAlert": "请不要关闭此窗口,您可以通过此页面底部的按钮完成此付款或取消此付款。",
"payTotalDeatail": "付款总额", "payTotalDeatail": "付款总额",
"payDeatail": "付款总额", "payDeatail": "付款总额",
"payTotal": "付款总额", "payTotal": "付款总额",


+ 2
- 0
src/translations/zh-HK.json View File

@@ -77,6 +77,7 @@
"fpsQrcodeTitle3":"請在規定時間內完成付款流程", "fpsQrcodeTitle3":"請在規定時間內完成付款流程",
"fpsQrcodeTitle4":"剩餘時間:", "fpsQrcodeTitle4":"剩餘時間:",
"fpsQrcodeTitle5":"秒", "fpsQrcodeTitle5":"秒",
"fpsQrcodeExpired":"二維碼已過期",


"payDnRemark": "在{date}下午12時30分前將付款證明(例如銀行入數紙或網上銀行付款記錄)電郵至 [email protected]", "payDnRemark": "在{date}下午12時30分前將付款證明(例如銀行入數紙或網上銀行付款記錄)電郵至 [email protected]",
"payNPGORemark" :"在{date}下午12時30分前到北角政府合署收款處完成付款", "payNPGORemark" :"在{date}下午12時30分前到北角政府合署收款處完成付款",
@@ -417,6 +418,7 @@
"payId": "付款編號", "payId": "付款編號",
"payConfirm": "確認付款", "payConfirm": "確認付款",
"payCancel": "取消付款", "payCancel": "取消付款",
"payAlert": "請不要關閉此窗口,您可以透過本頁底部的按鈕完成此付款或取消本付款。",
"payTotalDeatail": "付款總額", "payTotalDeatail": "付款總額",
"payDeatail": "付款總額", "payDeatail": "付款總額",
"payTotal": "付款總額", "payTotal": "付款總額",


Loading…
Cancel
Save