From 64d2cd0d93e4ef6ea91e4617007c7ef42bbf00a4 Mon Sep 17 00:00:00 2001 From: anna Date: Tue, 31 Oct 2023 18:09:20 +0800 Subject: [PATCH] success --- src/pages/Payment/Card/index.js | 2 +- src/pages/Payment/PaymentSuccess.js | 11 +++++++---- src/routes/PublicUserRoutes.js | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pages/Payment/Card/index.js b/src/pages/Payment/Card/index.js index 3e9e622..547b381 100644 --- a/src/pages/Payment/Card/index.js +++ b/src/pages/Payment/Card/index.js @@ -89,7 +89,7 @@ const Index = () => { }, // "locale":"", // "eserviceid":"", - "returnurl": "http://"+window.location.hostname+"/paymentPage/success/"+paymentData.transactionid+"/"+paymentData.webtoken + "returnurl": "http://"+window.location.hostname+"/paymentPage/success/"+paymentData.webtoken }, ///{state:{transactionid:paymentData.transactionid,webtoken:paymentData.webtoken} } onSuccess: function(responseData){ diff --git a/src/pages/Payment/PaymentSuccess.js b/src/pages/Payment/PaymentSuccess.js index f9f2bee..fc6ef10 100644 --- a/src/pages/Payment/PaymentSuccess.js +++ b/src/pages/Payment/PaymentSuccess.js @@ -43,14 +43,14 @@ const Index = () => { React.useEffect(() => { - if (params.transactionid != "" && params.webtoken != "") { + if (params.webtoken != "") { loadForm(); } }, []); React.useEffect(() => { console.log(responeData) - if (Object.keys(responeData).length > 0 && fpsmerchanttimeoutdatetime != "") { + if (Object.keys(responeData).length > 0) { setTransactionData(responeData) } }, [responeData]); @@ -68,10 +68,13 @@ const Index = () => { const trnTime = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); setTransactionDate(trnDate) setTransactionTime(trnTime) + const params = new URLSearchParams(window.location.pathname); + let transactionid = params.get("TRANSACTION_ID") + HttpUtils.post({ - url: paymentPath + paymentStatusApi + params.transactionid, + url: paymentPath + paymentStatusApi + transactionid, params: { - "apprefid": params.transactionid, + "apprefid": transactionid, "webtoken": params.webtoken, }, onSuccess: function (responseData) { diff --git a/src/routes/PublicUserRoutes.js b/src/routes/PublicUserRoutes.js index 722a0ed..26a4212 100644 --- a/src/routes/PublicUserRoutes.js +++ b/src/routes/PublicUserRoutes.js @@ -79,7 +79,7 @@ const PublicDashboard = { element: }, { - path: 'paymentPage/success/:transactionid/:webtoken', + path: 'paymentPage/success/:webtoken', element: }, {