|
|
@@ -1,5 +1,6 @@ |
|
|
|
import * as React from "react"; |
|
|
|
import * as HttpUtils from "utils/HttpUtils"; |
|
|
|
import * as UrlUtils from "utils/ApiPathConst"; |
|
|
|
import Loadable from 'components/Loadable'; |
|
|
|
const MultiPaymentWindow = Loadable(React.lazy(() => import('./MultiPaymentWindow'))); |
|
|
|
// const FPS = Loadable(React.lazy(() => import('./FPS'))); |
|
|
@@ -78,22 +79,51 @@ const Index = () => { |
|
|
|
setOpen(false); |
|
|
|
// let transactionid = ""; |
|
|
|
// let webtoken = ""; |
|
|
|
|
|
|
|
|
|
|
|
let page = ""; |
|
|
|
let stateParams = {}; |
|
|
|
let paymentMethod = ""; |
|
|
|
if(selectedPaymentMethod === "FPS"){ |
|
|
|
navigate('/paymentPage/fps', {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken} }); |
|
|
|
// navigate('/payment/fps', {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken} }); |
|
|
|
page='/paymentPage/fps'; |
|
|
|
stateParams= {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken} } |
|
|
|
paymentMethod = "04,BCFP,FPS"; |
|
|
|
}else if(selectedPaymentMethod ==="Visa"){ |
|
|
|
navigate('/paymentPage/card', {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"Visa", paymentMethod:"02,BCMP,CreditCard"} }); |
|
|
|
page='/paymentPage/card'; |
|
|
|
stateParams= {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"Visa", paymentMethod:"02,BCMP,CreditCard"} } |
|
|
|
paymentMethod = "02,BCMP,CreditCard"; |
|
|
|
}else if(selectedPaymentMethod ==="Mastercard"){ |
|
|
|
navigate('/paymentPage/card', {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"Mastercard", paymentMethod:"02,BCMP,CreditCard"} }); |
|
|
|
}else if(selectedPaymentMethod ==="UnionPay" ){ |
|
|
|
navigate('/paymentPage/card', {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"UnionPay", paymentMethod:"03,BCMP,CreditCard"} }); |
|
|
|
page='/paymentPage/card'; |
|
|
|
stateParams= {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"Mastercard", paymentMethod:"02,BCMP,CreditCard"} } |
|
|
|
paymentMethod = "02,BCMP,CreditCard"; |
|
|
|
}else if(selectedPaymentMethod ==="JCB"){ |
|
|
|
navigate('/paymentPage/card', {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"JCB", paymentMethod:"02,BCMP,CreditCard"} }); |
|
|
|
page='/paymentPage/card'; |
|
|
|
stateParams= {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"JCB", paymentMethod:"02,BCMP,CreditCard"} } |
|
|
|
paymentMethod = "02,BCMP,CreditCard"; |
|
|
|
}else if(selectedPaymentMethod ==="UnionPay" ){ |
|
|
|
page='/paymentPage/card'; |
|
|
|
stateParams= {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"UnionPay", paymentMethod:"03,BCMP,CreditCard"} } |
|
|
|
paymentMethod = "03,BCMP,CreditCard"; |
|
|
|
}else if(selectedPaymentMethod ==="PPS"){ |
|
|
|
navigate('/paymentPage/card', {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"PPS", paymentMethod:"01,PPSB,PPS"} }); |
|
|
|
page='/paymentPage/card'; |
|
|
|
stateParams= {state:{amount:totalAmount,transactionid:transactionData.transactionid,webtoken:transactionData.webtoken, type:"PPS", paymentMethod:"01,PPSB,PPS"} } |
|
|
|
paymentMethod = "01,PPSB,PPS"; |
|
|
|
} |
|
|
|
if(paymentMethod != ""){ |
|
|
|
HttpUtils.post({ |
|
|
|
url:UrlUtils.PAYMENT_CREATE, |
|
|
|
params:{ |
|
|
|
transNo:transactionData.transicationId, |
|
|
|
payMethod:paymentMethod, |
|
|
|
payAmount:totalAmount, |
|
|
|
appIdList:location.state?.appIdList??[] |
|
|
|
}, |
|
|
|
onSuccess:function(responData){ |
|
|
|
localStorage.removeItem("paymentId"); |
|
|
|
localStorage.setItem("paymentId", responData.id) |
|
|
|
navigate(page, stateParams); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, [confirmPayment]); |
|
|
|
|
|
|
|