Commit 67911fde authored by Bill's avatar Bill

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

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