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