fix(payment): 收口取消退款规则并保护退款状态

- 未确认订单取消直接生效:未收款删除,已收款进入退款
- 待取消期间到账只记账不退款,确认取消后再退
- 退款缺少支付流水时记录错误,关单/查单兜底补触发退款
- 已收款订单禁止改支付状态与金额,管理端 Agent 取消同步关单并退款
- 新增人工退款核销接口,切换支付方式不再自动退款
This commit is contained in:
lik
2026-11-06 17:30:20 +08:00
parent 7bd2590d1f
commit 623ecf2651
4 changed files with 200 additions and 34 deletions
+2
View File
@@ -99,6 +99,8 @@ function registerRoutes(app) {
router.post("/escort-record/:id/pay", requireAuth, createLimit, handlerPayment.createPayment.bind(handlerPayment));
router.get("/escort-record/:id/pay/status", requireAuth, handlerPayment.queryPayment.bind(handlerPayment));
router.post("/escort-record/:id/refund/query", requireAuth, requireAdmin, handlerPayment.queryRefundResult.bind(handlerPayment));
// 线下/人工退款核销:由平台确认已退款后把订单置为 refunded
router.post("/escort-record/:id/refund/manual", requireAuth, requireAdmin, handlerPayment.completeManualRefund.bind(handlerPayment));
router.get("/escort-record/:id", requireAuth, handlerEscortRecord.getRecordById.bind(handlerEscortRecord));
router.post("/escort-record", requireAuth, createLimit, handlerEscortRecord.createRecord.bind(handlerEscortRecord));