支付相关

This commit is contained in:
chen wei bo
2025-09-11 15:36:31 +08:00
parent 5accb0b507
commit a7e1724cc6
8 changed files with 118 additions and 34 deletions
@@ -22,13 +22,15 @@ export function mapQueryOrderStatus(
case 1: return "PENDING"; // 处理中
case 0: return "SUCCESS"; // 成功
case -1: return "FAILED"; // 失败
case 90: return "CANCELED"; // 取消
case 92: return "TIMEOUT"; // 轮询超时
default: return "CREATED"; // 未知/初始,按“已创建”兜底
}
}
/** 是否为终态(无需再轮询) */
export function isTerminalStatus(s: OrderStatus): boolean {
return s === "SUCCESS" || s === "FAILED" || s === "CANCELED" || s === "EXPIRED";
return s === "SUCCESS" || s === "FAILED" || s === "CANCELED" || s === "EXPIRED" || s === "TIMEOUT";
}
/** 是否应继续轮询查询订单 */