fix: HashPay 支付跳转到外部支付页面
This commit is contained in:
@@ -623,7 +623,7 @@ async function handleCheckout() {
|
|||||||
await cartStore.fetchCart()
|
await cartStore.fetchCart()
|
||||||
const orderId = res.data?.id
|
const orderId = res.data?.id
|
||||||
const selectedChannel = paymentChannels.value.find(ch => ch.code === selectedPayment.value)
|
const selectedChannel = paymentChannels.value.find(ch => ch.code === selectedPayment.value)
|
||||||
if (selectedChannel?.type === 'bepusdt' && orderId) {
|
if ((selectedChannel?.type === 'bepusdt' || selectedChannel?.type === 'hashpay') && orderId) {
|
||||||
router.push(`/checkout/${orderId}`)
|
router.push(`/checkout/${orderId}`)
|
||||||
} else {
|
} else {
|
||||||
router.push('/orders')
|
router.push('/orders')
|
||||||
|
|||||||
@@ -102,6 +102,13 @@ async function createPayment() {
|
|||||||
orderId.value = Number(route.params.id)
|
orderId.value = Number(route.params.id)
|
||||||
const res: any = await orderApi.createPayment(orderId.value)
|
const res: any = await orderApi.createPayment(orderId.value)
|
||||||
paymentInfo.value = res.data
|
paymentInfo.value = res.data
|
||||||
|
|
||||||
|
// HashPay: 直接跳转到外部支付页面
|
||||||
|
if (res.data.checkout_url) {
|
||||||
|
window.location.href = res.data.checkout_url
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
totalTime.value = res.data.expiration_time || 600
|
totalTime.value = res.data.expiration_time || 600
|
||||||
remaining.value = totalTime.value
|
remaining.value = totalTime.value
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user