refactor(pay): 统一流水号,移除订单/流水/提现三类号码前缀
订单号、资金流水号、提现单号此前各自带前缀配置,同一笔业务在不同界面会
呈现多个号码口径,对账与客诉排查都要先做一次前缀换算。现收敛为单一流水号
分配器,不再按业务类型区分号码形态。
- 删除 payment_order_prefix / payment_flow_prefix /
payment_withdrawal_prefix 三项配置项及其生成、校验链路
- BusinessNumber::allocate() 成为唯一入口,输出 {YmdHis}{6 位随机},
共 20 位无前缀,满足 VARCHAR(32) 与网关 out_trade_no ≤ 32 的限制
- 订单、资金流水、提现、卡密渠道交易号四处生成点全部改走该分配器
- 后台支付中心表头「订单号 / 提现单号」统一为「流水号」
- 前台用户中心与订单卡片文案同步统一;前台订单详情合并为单行流水号,
账本流水号不再下发到前台,避免同一单据出现两个对外号码
- 同步更新 financial-flow / pay-card / card-pass-order-numbers 契约测试
与 BusinessNumberTest 断言
按用户要求不做双路逻辑与数据迁移,直接替换为统一方案,历史行不做转换。
验证:node --test tests/**/*.test.cjs 362/364 通过,新增 37 项契约;失败的
2 项在改动前的干净 HEAD 基线上同样失败(基线 327 项 / 失败 2 项),分别命中
遗留的 fa fa- 标记与 FA 版本号断言,与本次改动无关。phpunit 44 项 / 103
断言全部通过;php -l 全部改动的 PHP 文件通过。
This commit is contained in:
1 parent
8b999444b2
commit
aad83072a8
30 files changed
+126
-144
No files matched your search
@@ -73,7 +73,7 @@ export const paymentSection = {
|
||||
route: '/payment/gateway',
|
||||
status: 'available',
|
||||
title: '收款接口',
|
||||
desc: '微信/支付宝接口选择、PayPal/Stripe 开关、货币结算、显示顺序与订单编号前缀。',
|
||||
desc: '微信/支付宝接口选择、PayPal/Stripe 开关、货币结算、显示顺序与订单支付时效。',
|
||||
canonicalDomain: 'payment',
|
||||
section: 'gateway',
|
||||
}),
|
||||
|
||||
@@ -30,14 +30,14 @@ const currencyOptions = [
|
||||
|
||||
/**
|
||||
* 收款接口 — 参考主题双下拉式重构:微信/支付宝接口选择(官方/易支付/关闭)、
|
||||
* PayPal/Stripe 独立开关、货币与结算、订单与编号(含三个前缀)、
|
||||
* PayPal/Stripe 独立开关、货币与结算、订单与编号、
|
||||
* 收款接口显示顺序,以及 5 个凭据配置块(支付宝/微信/PayPal/Stripe/易支付)。
|
||||
*/
|
||||
export const gatewaySchema = {
|
||||
key: 'payment.gateway',
|
||||
title: '收款接口',
|
||||
icon: 'fa fas fa-credit-card',
|
||||
description: '配置收款通道:微信与支付宝可在官方/易支付之间选择,PayPal 与 Stripe 独立开关。订单前缀、流水号前缀、提现单号前缀在本页配置。',
|
||||
description: '配置收款通道:微信与支付宝可在官方/易支付之间选择,PayPal 与 Stripe 独立开关。订单、资金流水与提现统一使用同一套自动流水号,无需配置前缀。',
|
||||
defaults: {
|
||||
pay_wechat_sdk_options: 'null',
|
||||
pay_alipay_sdk_options: 'null',
|
||||
@@ -49,9 +49,6 @@ export const gatewaySchema = {
|
||||
pay_alipay_settle: { settle_rate: '1', settle_mark: '¥', settle_unit: '元' },
|
||||
pay_sdk_custom_title_s: false,
|
||||
pay_sdk_custom_title: '',
|
||||
payment_order_prefix: 'AKSRT',
|
||||
payment_flow_prefix: 'AK',
|
||||
payment_withdrawal_prefix: 'TX',
|
||||
payment_order_expiry: 30,
|
||||
pay_wait_float_s: true,
|
||||
pay_sdk_order: {},
|
||||
@@ -167,11 +164,8 @@ export const gatewaySchema = {
|
||||
key: 'order',
|
||||
title: '订单与编号',
|
||||
icon: 'fa fas fa-hashtag',
|
||||
description: '订单号、流水号与提现单号的前缀配置(原名配置项保留于此)。',
|
||||
description: '订单支付时效与浮窗提示;订单、资金流水与提现的流水号由系统统一自动分配,无需配置。',
|
||||
fields: [
|
||||
{ key: 'payment_order_prefix', label: '订单前缀', type: 'input', default: 'AKSRT', help: '订单号生成前缀' },
|
||||
{ key: 'payment_flow_prefix', label: '流水号前缀', type: 'input', sanitize_type: 'business_prefix', default: 'AK', maxlength: 12, help: '仅允许字母、数字、下划线和短横线,最多 12 位。' },
|
||||
{ key: 'payment_withdrawal_prefix', label: '提现单号前缀', type: 'input', sanitize_type: 'business_prefix', default: 'TX', maxlength: 12, help: '仅允许字母、数字、下划线和短横线,最多 12 位。' },
|
||||
{ key: 'payment_order_expiry', label: '订单支付时效(分钟)', type: 'number', default: 30, min: 5, max: 1440, help: '用户下单后,最大支付时间,超过后订单将自动关闭(不能低于5分钟)' },
|
||||
{ key: 'pay_wait_float_s', label: '浮窗显示待支付订单', type: 'switch', default: true, help: '将用户待支付订单一直显示在右上角,提醒用户付款' },
|
||||
],
|
||||
|
||||
@@ -124,7 +124,7 @@ export const knowledgeSchema = {
|
||||
{ key: 'pay_mark', label: '付费标记', type: 'input', default: '付费' },
|
||||
{ key: 'payment_show_ip', label: '显示用户IP', type: 'switch', default: false },
|
||||
{ key: 'payment_show_device', label: '显示设备信息', type: 'switch', default: false },
|
||||
{ key: 'payment_show_order_no', label: '显示订单号', type: 'switch', default: true },
|
||||
{ key: 'payment_show_order_no', label: '显示流水号', type: 'switch', default: true },
|
||||
{ key: 'payment_show_create_time', label: '显示创建时间', type: 'switch', default: true },
|
||||
{ key: 'payment_show_pay_time', label: '显示支付时间', type: 'switch', default: true },
|
||||
],
|
||||
|
||||
@@ -994,7 +994,7 @@
|
||||
var number = document.createElement('span');
|
||||
number.className = 'uc-withdraw-history__number muted-2-color em09';
|
||||
var numberLabel = document.createElement('span');
|
||||
numberLabel.textContent = '提现单号:';
|
||||
numberLabel.textContent = '流水号:';
|
||||
number.appendChild(numberLabel);
|
||||
var code = document.createElement('code');
|
||||
code.textContent = text(item && item.withdrawal_number);
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
html += '<div><strong class="aksrt-order-detail__product-title">' + escapeHtml(title) + "</strong>";
|
||||
html += '<span class="aksrt-order-detail__product-meta">' + escapeHtml(order.product_type_label || "") + "</span></div></div>";
|
||||
html += '<dl class="aksrt-order-detail__list">';
|
||||
[["订单编号", order.order_number], ["流水号", order.flow_number || "—"], ["创建时间", order.created_at], ["支付时间", order.paid_at || "—"]].forEach(function (row) {
|
||||
[["流水号", order.order_number], ["创建时间", order.created_at], ["支付时间", order.paid_at || "—"]].forEach(function (row) {
|
||||
html += "<div><dt>" + escapeHtml(row[0]) + "</dt><dd>" + escapeHtml(row[1] || "—") + "</dd></div>";
|
||||
});
|
||||
html += "</dl>";
|
||||
@@ -186,7 +186,7 @@
|
||||
: "";
|
||||
return '<article class="aksrt-orders-page__card" data-aksrt-order-card="' + escapeHtml(order.order_number) + '" data-order-status="' + escapeHtml(order.status_group || "") + '">' +
|
||||
'<div class="aksrt-orders-page__card-rail"><span>' + escapeHtml(order.product_type_label || "") + '</span><time>' + escapeHtml(order.created_at || "") + '</time><span class="aksrt-orders-page__card-status is-' + escapeHtml(order.status_group || "") + '">' + escapeHtml(order.status_label || "") + "</span></div>" +
|
||||
'<div class="aksrt-orders-page__card-main">' + image + '<div class="aksrt-orders-page__card-copy"><h3>' + escapeHtml(order.product_name || "订单") + "</h3><p>订单号 " + escapeHtml(order.order_number) + "</p></div><div class=\"aksrt-orders-page__card-value\"><strong>" + formatMoney(order) + "</strong><span>实付</span></div></div>" +
|
||||
'<div class="aksrt-orders-page__card-main">' + image + '<div class="aksrt-orders-page__card-copy"><h3>' + escapeHtml(order.product_name || "订单") + "</h3><p>流水号 " + escapeHtml(order.order_number) + "</p></div><div class=\"aksrt-orders-page__card-value\"><strong>" + formatMoney(order) + "</strong><span>实付</span></div></div>" +
|
||||
'<footer class="aksrt-orders-page__card-actions">' + countdown + actionHtml(order) + "</footer></article>";
|
||||
}
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@
|
||||
if (data.redirect && (data.payment_url || data.qr_content)) {
|
||||
callback(options, "onPending", data);
|
||||
if (!data.order_number) {
|
||||
var missing = { ok: false, status: 500, json: { message: "支付订单号缺失" } };
|
||||
var missing = { ok: false, status: 500, json: { message: "流水号缺失" } };
|
||||
callback(options, "onError", missing);
|
||||
return missing;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user