update pay channel
This commit is contained in:
parent
08e0d8cbec
commit
6d8eebbff0
@ -35,9 +35,10 @@ const ExternalCreate = () => {
|
|||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const createBill = (params: ExternalCreateParamsType) => {
|
const createBill = (params: ExternalCreateParamsType) => {
|
||||||
setState({loading: true})
|
setState({loading: true})
|
||||||
|
const pay_channel = searchParams.get('pay_channel') || 'asia_pay'
|
||||||
createExternalBill(params).then((ret) => {
|
createExternalBill(params).then((ret) => {
|
||||||
setState({loading: false})
|
setState({loading: false})
|
||||||
navigate(`/pay?bill=${ret.id}`, {replace: true})
|
navigate(`/pay?bill=${ret.id}&pay_channel=${pay_channel}`, {replace: true})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
setState({loading: false, 'error': 'create pay order failed'})
|
setState({loading: false, 'error': 'create pay order failed'})
|
||||||
})
|
})
|
||||||
|
@ -17,7 +17,7 @@ import {StartFlyWire} from "@/pages/pay/component/start-fly-wire.tsx";
|
|||||||
const PayIndex = () => {
|
const PayIndex = () => {
|
||||||
const {t} = useTranslation()
|
const {t} = useTranslation()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const [payChannel, setPayChannel] = useState('asia_pay')
|
const [payChannel, setPayChannel] = useState('')
|
||||||
const [search] = useSearchParams();
|
const [search] = useSearchParams();
|
||||||
const [bill, setBill] = useState<BillModel>()
|
const [bill, setBill] = useState<BillModel>()
|
||||||
|
|
||||||
@ -27,6 +27,9 @@ const PayIndex = () => {
|
|||||||
navigate(`/pay/error?bill=${billId}`, {replace: true})
|
navigate(`/pay/error?bill=${billId}`, {replace: true})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const payChannel = search.get('pay_channel') || 'asia_pay'
|
||||||
|
setPayChannel(payChannel)
|
||||||
getBillDetail(Number(billId)).then((bill) => {
|
getBillDetail(Number(billId)).then((bill) => {
|
||||||
// 判断bill状态
|
// 判断bill状态
|
||||||
if (bill.status != BillStatus.PENDING) {
|
if (bill.status != BillStatus.PENDING) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user