mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-22 14:11:51 +00:00
fix(payment): prioritize actual order status over URL params in result page
This commit is contained in:
@@ -98,14 +98,13 @@ interface ReturnInfo {
|
||||
const returnInfo = ref<ReturnInfo | null>(null)
|
||||
|
||||
const isSuccess = computed(() => {
|
||||
// Internal flow: explicit status=success
|
||||
if (route.query.status === 'success') return true
|
||||
// EasyPay return flow: trade_status=TRADE_SUCCESS
|
||||
if (route.query.trade_status === 'TRADE_SUCCESS') return true
|
||||
// Order-based check
|
||||
// Always prioritize actual order status from backend
|
||||
if (order.value) {
|
||||
return order.value.status === 'COMPLETED' || order.value.status === 'PAID'
|
||||
}
|
||||
// Fallback only when order not loaded
|
||||
if (route.query.status === 'success') return true
|
||||
if (route.query.trade_status === 'TRADE_SUCCESS') return true
|
||||
return false
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user