Commit 67911fde authored by Bill's avatar Bill

fix: 修改结算通联支付接口参数

parent 6c58b94e
...@@ -14,12 +14,12 @@ interface Iprops { ...@@ -14,12 +14,12 @@ interface Iprops {
/** 商户订单号 */ /** 商户订单号 */
tradeCode: string tradeCode: string
onClose?: () => void, onClose?: () => void,
/** 时间戳随机码 */ // /** 时间戳随机码 */
randomCode: string // randomCode: string
} }
const GetCodeModal: React.FC<Iprops> = (props: Iprops) => { const GetCodeModal: React.FC<Iprops> = (props: Iprops) => {
const { title = '验证码', onOk, visible, tradeCode, onClose, randomCode } = props; const { title = '验证码', onOk, visible, tradeCode, onClose } = props;
const [code, setCode] = useState<string>(""); const [code, setCode] = useState<string>("");
const { text, isActive, start } = useCountDown({ const { text, isActive, start } = useCountDown({
maxTime: 60, maxTime: 60,
...@@ -49,7 +49,7 @@ const GetCodeModal: React.FC<Iprops> = (props: Iprops) => { ...@@ -49,7 +49,7 @@ const GetCodeModal: React.FC<Iprops> = (props: Iprops) => {
const handleSendCode = async () => { const handleSendCode = async () => {
const { code, data } = await getPayEAccountAllInPayReSendPayCode({ const { code, data } = await getPayEAccountAllInPayReSendPayCode({
tradeCode: `${tradeCode}-${randomCode}` tradeCode: `${tradeCode}`
}) })
if (code === 1000) { if (code === 1000) {
start(); start();
......
...@@ -19,6 +19,7 @@ import { ...@@ -19,6 +19,7 @@ import {
getSettleAccountsCommonGetSettlementOrderType, getSettleAccountsCommonGetSettlementOrderType,
getSettleAccountsCommonGetSettlementStatus, getSettleAccountsCommonGetSettlementStatus,
getSettleAccountsMemberSettlementCommunicationPayResult, getSettleAccountsMemberSettlementCommunicationPayResult,
getSettleAccountsMemberSettlementGetCommunicationPayTradeNo,
getSettleAccountsMemberSettlementGetPayablePayProve, getSettleAccountsMemberSettlementGetPayablePayProve,
getSettleAccountsMemberSettlementPagePayableSettlement, getSettleAccountsMemberSettlementPagePayableSettlement,
GetSettleAccountsMemberSettlementPagePayableSettlementRequest, GetSettleAccountsMemberSettlementPagePayableSettlementRequest,
...@@ -157,12 +158,13 @@ const SettlementList = () => { ...@@ -157,12 +158,13 @@ const SettlementList = () => {
} }
/** 通联支付,短信验证码支付 */ /** 通联支付,短信验证码支付, 这里是后台随机生成的结算单 */
const handleCompleteSmsCode = async (codeString: string) => { const handleCompleteSmsCode = async (codeString: string) => {
const { code, data, message: msg } = await postPayEAccountAllInPayConfirmPay({ const { code, data, message: msg } = await postPayEAccountAllInPayConfirmPay({
tradeCode: `${itemInfo.settlementNo}-${randomCode}`, // tradeCode: `${itemInfo.settlementNo}-${randomCode}`,
tradeCode: randomCode,
verificationCode: codeString verificationCode: codeString
}) }, { ctlType: 'none' })
if (code !== 1000) { if (code !== 1000) {
message.error(msg); message.error(msg);
return; return;
...@@ -176,13 +178,19 @@ const SettlementList = () => { ...@@ -176,13 +178,19 @@ const SettlementList = () => {
const channel = params.payChannel; const channel = params.payChannel;
try { try {
setUniversalPayLoading(true) setUniversalPayLoading(true)
const randomCodeDate = "" + new Date().valueOf() const res = await getSettleAccountsMemberSettlementGetCommunicationPayTradeNo({
setRandomCode(randomCodeDate); id: itemInfo.id.toString()
})
if (res.code !== 1000) {
message.error(res.message);
return;
}
setRandomCode(res.data);
// TODO 加一个随机数 // TODO 加一个随机数
const { data, code, message: msg } = await postSettleAccountsMemberSettlementCommunicationPay({ const { data, code, message: msg } = await postSettleAccountsMemberSettlementCommunicationPay({
id: itemInfo.id, id: itemInfo.id,
payChannelType: params.payChannel, payChannelType: params.payChannel,
settlementNo: `${itemInfo.settlementNo}-${randomCodeDate}`,
}, {ctlType: 'none'}) }, {ctlType: 'none'})
if (code !== 1000) { if (code !== 1000) {
message.error(msg); message.error(msg);
...@@ -327,9 +335,9 @@ const SettlementList = () => { ...@@ -327,9 +335,9 @@ const SettlementList = () => {
<GetCodeModal <GetCodeModal
visible={modals.smsCodeModal} visible={modals.smsCodeModal}
onOk={handleCompleteSmsCode} onOk={handleCompleteSmsCode}
tradeCode={itemInfo?.settlementNo} tradeCode={randomCode}
onClose={() => handleClose('smsCodeModal')} onClose={() => handleClose('smsCodeModal')}
randomCode={randomCode} // randomCode={randomCode}
/> />
</PageHeaderWrapper> </PageHeaderWrapper>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment