Anna Ho pirms 1 gada
vecāks
revīzija
40f775be19
1 mainītis faili ar 6 papildinājumiem un 64 dzēšanām
  1. +6
    -64
      src/pages/Payment/Card/index.js

+ 6
- 64
src/pages/Payment/Card/index.js Parādīt failu

@@ -52,22 +52,18 @@ const Index = () => {
// const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/";
// const receiverUrl = "/noti-api/payment/payment-notification";

//timer
const currentTimer = React.useRef();
const [time, setTime] = React.useState(0);

React.useEffect(() => {
if (location.state != undefined) {
setPaymentData(location.state)
}
loadForm();
currentTimer.current = setInterval(() => {
getPaymentStatus();
setTime((prevTime) => prevTime + 1);
}, 500);
return () => clearInterval(currentTimer.current);
}, []);

React.useEffect(() => {
if (Object.keys(paymentData).length > 0){
loadForm();
}
}, [paymentData]);

React.useEffect(() => {
setOnReady(true);
}, [redirecturl]);
@@ -115,32 +111,6 @@ const Index = () => {
});
}

const getPaymentStatus = () => {

// HttpUtils.post({
// url: paymentPath+paymentStatusApi+paymentid,
// params:{
// "apprefid": paymentData.transactionid,
// "webtoken": paymentData.webtoken,
// },
// onSuccess: function(responseData){
// const paymentstatuscode = responseData.paymentdetail.result.paymentstatuscode;
// if (paymentstatuscode === 'APPR') {
// const timestamp = '?t=' + Date.now();
// window.top.location.href = paymentPath + payment.config.ackPagePath + timestamp;
// } else if (paymentstatuscode === 'CANC') {
// window.top.location.href = paymentPath + payment.config.indexPagePath;
// } else {
// window.top.location.href = paymentPath + payment.config.errPagePath;
// }
// },
// onError: function(){
// cancelPayment()
// clearInterval(currentTimer.current);
// }
// });
};

React.useEffect(() => {
const timeOutDate = new Date(fpsmerchanttimeoutdatetime);
const currentTime = new Date;
@@ -164,34 +134,6 @@ const Index = () => {
});
}

// const getPayload = ()=>{
// HttpUtils.get({
// url: payloadUrl+"<paymenttoken>",
// onSuccess: function(responseData){
// /*
// {
// "payload": "<payload>"
// }

// */
// }
// });
// }

// const getReceiver = ()=>{
// HttpUtils.get({
// url: receiverUrl+"<paymenttoken>",
// onSuccess: function(responseData){
// /*
// {
// "payload": "<payload>"
// }

// */
// }
// });
// }

const getIcon = () => {
if(paymentData.type=="Visa") return VisaIcon;
if(paymentData.type=="Mastercard") return MasterIcon;


Notiek ielāde…
Atcelt
Saglabāt