fix payment resume result consistency

This commit is contained in:
IanShaw027
2026-04-21 02:08:34 +08:00
parent e12599c1b9
commit a27a7add3d
6 changed files with 264 additions and 14 deletions

View File

@@ -194,6 +194,10 @@ const countdownDisplay = computed(() => {
return m.toString().padStart(2, '0') + ':' + s.toString().padStart(2, '0')
})
function isSuccessStatus(status: string | null | undefined): boolean {
return status === 'COMPLETED' || status === 'PAID' || status === 'RECHARGING'
}
function reopenPopup() {
if (props.payUrl) {
const win = window.open(props.payUrl, 'paymentPopup', POPUP_WINDOW_FEATURES)
@@ -222,7 +226,7 @@ async function pollStatus() {
if (!props.orderId || outcome.value) return
const order = await paymentStore.pollOrderStatus(props.orderId)
if (!order) return
if (order.status === 'COMPLETED' || order.status === 'PAID') {
if (isSuccessStatus(order.status)) {
cleanup()
paidOrder.value = order
setOutcome('success')