| @@ -7,10 +7,11 @@ import { | |||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import * as React from "react"; | import * as React from "react"; | ||||
| import * as HttpUtils from "utils/HttpUtils"; | import * as HttpUtils from "utils/HttpUtils"; | ||||
| import * as UrlUtils from "utils/ApiPathConst"; | |||||
| import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
| import { useLocation } from 'react-router-dom'; | import { useLocation } from 'react-router-dom'; | ||||
| import {paymentPath} from "auth/utils"; | |||||
| // import {paymentPath} from "auth/utils"; | |||||
| // import {poll} from "utils/Utils"; | // import {poll} from "utils/Utils"; | ||||
| import VisaIcon from "assets/images/icons/visacard.svg"; | import VisaIcon from "assets/images/icons/visacard.svg"; | ||||
| import MasterIcon from "assets/images/icons/mastercard.svg"; | import MasterIcon from "assets/images/icons/mastercard.svg"; | ||||
| @@ -45,7 +46,7 @@ const Index = () => { | |||||
| // const [fpsqrcodeurl, setFpsqrcodeurl] = React.useState(""); | // const [fpsqrcodeurl, setFpsqrcodeurl] = React.useState(""); | ||||
| // const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD | // const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD | ||||
| // const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing | // const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing | ||||
| const loadPaymentUrl = "/api/payment/web/"; | |||||
| // const loadPaymentUrl = "/api/payment/web/"; | |||||
| // const paymentStatusApi = "/api/payment/status/"; | // const paymentStatusApi = "/api/payment/status/"; | ||||
| // const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/"; | // const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/"; | ||||
| // const receiverUrl = "/noti-api/payment/payment-notification"; | // const receiverUrl = "/noti-api/payment/payment-notification"; | ||||
| @@ -74,7 +75,7 @@ const Index = () => { | |||||
| localStorage.setItem("webtoken", paymentData.webtoken) | localStorage.setItem("webtoken", paymentData.webtoken) | ||||
| HttpUtils.post({ | HttpUtils.post({ | ||||
| url: paymentPath+loadPaymentUrl+(paymentData.type=="PPS"?"pps":"creditcard"), | |||||
| url: UrlUtils.LOAD_PAYMENT_URL+(paymentData.type=="PPS"?"pps":"creditcard"), | |||||
| params:{ | params:{ | ||||
| "transactionid": paymentData.transactionid, | "transactionid": paymentData.transactionid, | ||||
| //"apprefid:": paymentData.transactionid, | //"apprefid:": paymentData.transactionid, | ||||
| @@ -11,7 +11,7 @@ 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 { 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"; | ||||
| // import {poll} from "utils/Utils"; | // import {poll} from "utils/Utils"; | ||||
| @@ -54,8 +54,8 @@ const Index = () => { | |||||
| const pasgPathPrd = 'https://fps.payapps.hkicl.com.hk'; //PRD | const pasgPathPrd = 'https://fps.payapps.hkicl.com.hk'; //PRD | ||||
| const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing | const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing | ||||
| const loadPaymentUrl = "/api/payment/wallet/fps"; | |||||
| const cancelPaymentUrl = "/api/payment/cancelpayment"; | |||||
| // const loadPaymentUrl = "/api/payment/wallet/fps"; | |||||
| // const cancelPaymentUrl = "/api/payment/cancelpayment"; | |||||
| // const paymentStatusApi = "/api/payment/status/"; | // const paymentStatusApi = "/api/payment/status/"; | ||||
| // const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/"; | // const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/"; | ||||
| // const receiverUrl = "/noti-api/payment/payment-notification"; | // const receiverUrl = "/noti-api/payment/payment-notification"; | ||||
| @@ -132,10 +132,10 @@ const Index = () => { | |||||
| HttpUtils.post({ | HttpUtils.post({ | ||||
| url: paymentPath+loadPaymentUrl, | |||||
| url: UrlUtils.LOAD_PAYMENT_FPS_URL, | |||||
| params:{ | params:{ | ||||
| "transactionid": transactionid, | |||||
| "webtoken": webtoken, | |||||
| // "transactionid": transactionid, | |||||
| // "webtoken": webtoken, | |||||
| "paymentmethod":"04,BCFP,FPS", | "paymentmethod":"04,BCFP,FPS", | ||||
| "order": { | "order": { | ||||
| "totalamount":paymentData.amount, | "totalamount":paymentData.amount, | ||||
| @@ -190,7 +190,6 @@ const Index = () => { | |||||
| setFpsqrcodeurl(openPASGUrl) | setFpsqrcodeurl(openPASGUrl) | ||||
| setFpsqrcodeurlPrd(openPASGUrlPrd) | setFpsqrcodeurlPrd(openPASGUrlPrd) | ||||
| setFpsqrcodeurlFps(openPASGUrlPrdFps) | setFpsqrcodeurlFps(openPASGUrlPrdFps) | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -247,7 +246,7 @@ const Index = () => { | |||||
| const cancelPayment = ()=>{ | const cancelPayment = ()=>{ | ||||
| if (Object.keys(paymentData).length>0){ | if (Object.keys(paymentData).length>0){ | ||||
| HttpUtils.post({ | HttpUtils.post({ | ||||
| url: paymentPath+cancelPaymentUrl, | |||||
| url: UrlUtils.CANCEL_PAYMENT_URL, | |||||
| params:{ | params:{ | ||||
| "transactionid": paymentData.transactionid, | "transactionid": paymentData.transactionid, | ||||
| "webtoken": paymentData.webtoken, | "webtoken": paymentData.webtoken, | ||||
| @@ -156,7 +156,8 @@ const Index = () => { | |||||
| transNo: transactionData.transactionid, | transNo: transactionData.transactionid, | ||||
| payMethod: paymentMethod, | payMethod: paymentMethod, | ||||
| payAmount: totalAmount, | payAmount: totalAmount, | ||||
| appIdList: location.state?.appIdList ?? [] | |||||
| appIdList: location.state?.appIdList ?? [], | |||||
| webtoken: transactionData.webtoken | |||||
| }, | }, | ||||
| onSuccess: function (responData) { | onSuccess: function (responData) { | ||||
| localStorage.removeItem("paymentId"); | localStorage.removeItem("paymentId"); | ||||
| @@ -171,7 +172,7 @@ const Index = () => { | |||||
| }); | }); | ||||
| } | } | ||||
| //For testing | |||||
| // For testing | |||||
| // if (paymentMethod != "") { | // if (paymentMethod != "") { | ||||
| // HttpUtils.post({ | // HttpUtils.post({ | ||||
| // url: UrlUtils.PAYMENT_CREATE, | // url: UrlUtils.PAYMENT_CREATE, | ||||
| @@ -179,7 +180,9 @@ const Index = () => { | |||||
| // transNo: "test0002", | // transNo: "test0002", | ||||
| // payMethod: paymentMethod, | // payMethod: paymentMethod, | ||||
| // payAmount: totalAmount, | // payAmount: totalAmount, | ||||
| // appIdList: location.state?.appIdList ?? [] | |||||
| // appIdList: location.state?.appIdList ?? [], | |||||
| // webtoken: "test000234123412341234123412354212312412341234124123124124124123124123124124" | |||||
| // }, | // }, | ||||
| // onSuccess: function (responData) { | // onSuccess: function (responData) { | ||||
| // localStorage.removeItem("paymentId"); | // localStorage.removeItem("paymentId"); | ||||
| @@ -157,9 +157,11 @@ export const PAYMENT_AVAILABLE_PAYMENT = apiPath+'/payment/api/availability';//P | |||||
| export const PAYMENT_TRANSACTION_ID = apiPath+'/payment/api/transaction';//GET | export const PAYMENT_TRANSACTION_ID = apiPath+'/payment/api/transaction';//GET | ||||
| // export const PAYMENT_STATUS_API = paymentPath+'/api/payment/status/';//POST | // export const PAYMENT_STATUS_API = paymentPath+'/api/payment/status/';//POST | ||||
| export const PAYMENT_STATUS_API = apiPath+'/payment/api/status/';//POST | export const PAYMENT_STATUS_API = apiPath+'/payment/api/status/';//POST | ||||
| export const LOAD_PAYMENT_URL = apiPath+ "/api/payment/wallet/fps";//POST | |||||
| export const CANCEL_PAYMENT_URL = apiPath+ "/api/payment/cancelpayment";//POST | |||||
| // export const LOAD_PAYMENT_URL = paymentPath+ "/api/payment/wallet/fps";//POST | |||||
| export const LOAD_PAYMENT_FPS_URL = apiPath+ "/payment/api/wallet/fps";//POST | |||||
| // export const CANCEL_PAYMENT_URL = paymentPath+ "/api/payment/cancelpayment";//POST | |||||
| export const CANCEL_PAYMENT_URL = apiPath+ "/payment/api/cancelpayment";//POST | |||||
| export const LOAD_PAYMENT_URL = apiPath+ "/payment/api/web/";//POST | |||||
| export const DEMAND_NOTE_PREVIEW = apiPath+'/demandNote/preview';//GET | export const DEMAND_NOTE_PREVIEW = apiPath+'/demandNote/preview';//GET | ||||
| export const DEMAND_NOTE_CREATE = apiPath+'/demandNote/create';//POST | export const DEMAND_NOTE_CREATE = apiPath+'/demandNote/create';//POST | ||||