|
|
@@ -115,12 +115,7 @@ const Index = () => { |
|
|
|
}, [fpsTransctionData]); |
|
|
|
|
|
|
|
|
|
|
|
const loadForm = () => () =>{ |
|
|
|
// const timeoutdatetime = "2023-10-26T09:04:30Z[UTC]" |
|
|
|
// const convertedDateString = timeoutdatetime.replace("[UTC]", ""); |
|
|
|
// setFpsmerchanttimeoutdatetime(convertedDateString) |
|
|
|
// setPaymentid("C202310268000681") |
|
|
|
// setPaymentstatuscode("APPR") |
|
|
|
const loadForm = () => { |
|
|
|
const webtoken = paymentData.webtoken; |
|
|
|
const transactionid = paymentData.transactionid; |
|
|
|
console.log(webtoken) |
|
|
@@ -130,7 +125,6 @@ const Index = () => { |
|
|
|
localStorage.setItem("transactionid", transactionid) |
|
|
|
localStorage.setItem("webtoken", webtoken) |
|
|
|
|
|
|
|
|
|
|
|
HttpUtils.post({ |
|
|
|
url: UrlUtils.LOAD_PAYMENT_FPS_URL, |
|
|
|
params:{ |
|
|
@@ -192,16 +186,48 @@ const Index = () => { |
|
|
|
setFpsqrcodeurlFps(openPASGUrlPrdFps) |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//testing |
|
|
|
// const timeoutdatetime = "2024-05-06T11:10:30Z[UTC]" |
|
|
|
// const convertedDateString = timeoutdatetime.replace("[UTC]", ""); |
|
|
|
// setFpsmerchanttimeoutdatetime(convertedDateString) |
|
|
|
// setPaymentId("C202310268000681") |
|
|
|
// const responseData= |
|
|
|
// { |
|
|
|
// "paymentid": "C202310268000681", |
|
|
|
// "paymentstatus": "INPR", |
|
|
|
// "fpsmerchanttimeoutdatetime": "2024-05-06T11:10:30Z[UTC]", |
|
|
|
// "fpsqrcodeimgbase64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAuyklEQVR4Xu3dfcy/d1nff2IAAAAASUVORK5CYII=", |
|
|
|
// "fpsqrcodeurl": "http://127.0.0.1:8080/api/payment/wallet/fps/enquiryfpspayload/vm.JKDDlTOavR3ASviSwUnS1Lw4-" |
|
|
|
// } |
|
|
|
// setResponeDataData(responseData) |
|
|
|
// const parsedUrl = new URL(responseData.fpsqrcodeurl); |
|
|
|
// const fpsqrcodeurl = "https://"+window.location.hostname+'/payment'+parsedUrl.pathname; |
|
|
|
// const fpsqrcodeurlwithFps = "https://"+"fps."+window.location.hostname+parsedUrl.pathname; |
|
|
|
// console.log(parsedUrl) |
|
|
|
// console.log(fpsqrcodeurl) |
|
|
|
// console.log(fpsqrcodeurlwithFps) |
|
|
|
|
|
|
|
// const openPASGUrl = pasgPath + '?pay_req_obj=' + encodeURIComponent(fpsqrcodeurl) + '&callback=' |
|
|
|
// + encodeURIComponent("https://"+window.location.hostname+ '/paymentPage/fps/fpscallback?TRANSACTION_ID='+transactionid+"&WEB_TOKEN="+webtoken+"&PAYMENT_ID="+localStorage.getItem("paymentId")); |
|
|
|
// const openPASGUrlPrd = pasgPathPrd + '?pay_req_obj=' + encodeURIComponent(fpsqrcodeurl) + '&callback=' |
|
|
|
// + encodeURIComponent("https://"+window.location.hostname+ '/paymentPage/fps/fpscallback?TRANSACTION_ID='+transactionid+"&WEB_TOKEN="+webtoken+"&PAYMENT_ID="+localStorage.getItem("paymentId")); |
|
|
|
// const openPASGUrlPrdFps = pasgPath + '?pay_req_obj=' + encodeURIComponent(fpsqrcodeurlwithFps) + '&callback=' |
|
|
|
// + encodeURIComponent("https://"+window.location.hostname+ '/paymentPage/fps/fpscallback?TRANSACTION_ID='+transactionid+"&WEB_TOKEN="+webtoken+"&PAYMENT_ID="+localStorage.getItem("paymentId")); |
|
|
|
// setFpsqrcodeurl(openPASGUrl) |
|
|
|
// setFpsqrcodeurlPrd(openPASGUrlPrd) |
|
|
|
// setFpsqrcodeurlFps(openPASGUrlPrdFps) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const getPaymentStatus = () => { |
|
|
|
if(Object.keys(paymentData).length > 0){ |
|
|
|
HttpUtils.post({ |
|
|
|
url: UrlUtils.PAYMENT_STATUS_API+paymentData.transactionid, |
|
|
|
url: UrlUtils.PAYMENT_STATUS_API, |
|
|
|
params:{ |
|
|
|
"apprefid": paymentData.transactionid, |
|
|
|
"webtoken": paymentData.webtoken, |
|
|
|
// "webtoken": paymentData.webtoken, |
|
|
|
"transactionid":Number(paymentData.transactionid) |
|
|
|
}, |
|
|
|
onSuccess: function(responseData){ |
|
|
|
const paymentstatuscode = responseData.paymentdetail.result.paymentstatuscode; |
|
|
@@ -241,7 +267,7 @@ const Index = () => { |
|
|
|
// console.log(timeOutDate.getTime()-currentTime.getTime()) |
|
|
|
getPaymentStatus(); |
|
|
|
if (timeOutDate.getTime()<currentTime.getTime()){ |
|
|
|
console.log("stop"); |
|
|
|
// console.log("stop"); |
|
|
|
clearInterval(currentTimer.current); |
|
|
|
cancelPayment() |
|
|
|
} |
|
|
@@ -257,7 +283,10 @@ const Index = () => { |
|
|
|
"paymentid": fpsTransctionData.paymentid |
|
|
|
}, |
|
|
|
onSuccess: function(){ |
|
|
|
navigate('/paymentPage/fps/ackpage'); |
|
|
|
// navigate('/paymentPage/fps/ackpage'); |
|
|
|
let page = '/paymentPage/fps/ackpage'; |
|
|
|
let stateParams = { state: { transactionid: paymentData.transactionid} } |
|
|
|
navigate(page, stateParams); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|