优化支付功能

This commit is contained in:
2026-09-16 14:28:07 +08:00
parent ac14452cae
commit 605c2a569f
19 changed files with 1020 additions and 479 deletions
+23 -8
View File
@@ -20,9 +20,8 @@ const COMMISSION = "/platform/commission";
/**
* 创建支付单
* TODO: 后端实现 POST /api/payment/create
* 约定入参:{ out_trade_no, tenant_id, order_type, amount(分), channel, subject, return_url, client_ip }
* 约定返回:{ pay_no, channel, pay_params } pay_params 交给前端拉起渠道支付
*
* 该接口仅供租户端收银台使用;平台端不直接创建支付单。
* @param {Object} data 下单参数
* @returns {Promise}
*/
@@ -35,17 +34,16 @@ export function createPayment(data) {
}
/**
* 查询支付单(本地库)
* TODO: 后端实现 GET /api/payment/query/:payNo
* 手动查询支付单并同步渠道状态
* @param {string} payNo 支付单号
* @param {Object} [params] { sync: true } 时同步渠道最新状态后再返回
* @returns {Promise}
*/
export function queryPayment(payNo, params = {}) {
return request({
url: `${PAY}/query/${payNo}`,
method: "get",
params,
url: `${PAY}/orders/${payNo}/query`,
method: "post",
data: params,
});
}
@@ -301,6 +299,23 @@ export function toggleCommissionRule(id, status) {
/* ================= 对账 ================= */
export function runReconcile(data) {
return request({
url: `${PAY}/reconcile/run`,
method: "post",
data,
});
}
export function importReconcileBill(data) {
return request({
url: `${PAY}/reconcile/import`,
method: "post",
data,
timeout: 0,
});
}
/**
* 对账差异列表
* TODO: 后端实现 GET /api/payment/reconcile