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 },
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user