diff --git a/src/pages/Payment/FPS/FPS.js b/src/pages/Payment/FPS/FPS.js
index cdd70e8..492ac8b 100644
--- a/src/pages/Payment/FPS/FPS.js
+++ b/src/pages/Payment/FPS/FPS.js
@@ -41,8 +41,8 @@ const Index = () => {
const [fpsTransctionData, setFpsTransctionData] = React.useState({});
const [fpsmerchanttimeoutdatetime, setFpsmerchanttimeoutdatetime] = React.useState("");
const [timeDownCount, setTimeDownCount] = React.useState(0);
-
- // const [fpsqrcodeurl, setFpsqrcodeurl] = React.useState("");
+ const [paymentId, setPaymentId] = React.useState("");
+ const [fpsqrcodeurl, setFpsqrcodeurl] = React.useState("");
// const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD
// const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing
const loadPaymentUrl = "/api/payment/wallet/fps";
@@ -50,7 +50,9 @@ const Index = () => {
const paymentStatusApi = "/api/payment/status/";
// const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/";
// const receiverUrl = "/noti-api/payment/payment-notification";
-
+ const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing
+ // const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD
+
//timer
const currentTimer = React.useRef();
const [time, setTime] = React.useState(0);
@@ -60,6 +62,13 @@ const Index = () => {
if(Object.keys(location.state).length > 0){
console.log (location.state)
setLocationData(location.state)
+ if (/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)) {
+ console.log('Mobile web browser');
+ console.log(openPASGUrl)
+ // renderOpenFPSPaymentAppTemplate(openPASGUrl, $('#openFPSPaymentAppTemplate').html());
+ } else {
+ console.log('Desktop web browser');
+ }
}
}, []);
@@ -89,6 +98,7 @@ const Index = () => {
// console.log(fpsTransctionData)
if(Object.keys(fpsTransctionData).length > 0 ){
setOnReady(true);
+ setPaymentId(fpsTransctionData.paymentid)
currentTimer.current = setInterval(() => {
setTime((prevTime) => prevTime + 1);
}, 1000);
@@ -146,11 +156,9 @@ const Index = () => {
setFpsmerchanttimeoutdatetime(convertedDateString)
// const parsedUrl = new URL(responseData.fpsqrcodeurl);
// const fpsqrcodeurl = parsedUrl.pathname;
- // const openPASGUrl = pasgPath + '?pay_req_obj=' + encodeURIComponent(responseData.fpsqrcodeurl) + '&callback='
- // + encodeURIComponent(paymentPath + payment.config.fpscallbackPage);
- // setFpsqrcodeurl(openPASGUrl)
-
-
+ const openPASGUrl = pasgPath + '?pay_req_obj=' + encodeURIComponent(responseData.fpsqrcodeurl) + '&callback='
+ + encodeURIComponent("https://"+window.location.hostname+ '/paymentPage/fps/ackpage');
+ setFpsqrcodeurl(openPASGUrl)
}
});
@@ -220,6 +228,10 @@ const Index = () => {
}
}
+ const mobliePayment = ()=>{
+ window.location.assign(fpsqrcodeurl);
+ }
+
return (
!onReady ?
@@ -252,7 +264,7 @@ const Index = () => {
- {fpsTransctionData.paymentdetails?.paymentid}
+ {paymentId}
二維碼有效期限3分鐘
@@ -260,7 +272,18 @@ const Index = () => {
{"剩餘時間:"+timeDownCount}
-
+
+
+