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
@@ -1567,7 +1567,7 @@ if (!function_exists('aksrt_get_paid_box_html')) {
|
||||
}
|
||||
$amount_text = $cash_symbol . aksrt_format_price($order_amount);
|
||||
}
|
||||
$paid_info = '<div class="flex jsb"><span>' . esc_html__('订单号', 'aksrt') . '</span><span>' . esc_html($order_number) . '</span></div>';
|
||||
$paid_info = '<div class="flex jsb"><span>' . esc_html__('流水号', 'aksrt') . '</span><span>' . esc_html($order_number) . '</span></div>';
|
||||
if ($paid_at !== '') {
|
||||
$paid_info .= '<div class="flex jsb"><span>' . esc_html__('支付时间', 'aksrt') . '</span><span>' . esc_html($paid_at) . '</span></div>';
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ $currency_labels = [
|
||||
$status = (string) ($item['status'] ?? '') === 'pending' ? 'pending' : 'settled';
|
||||
$amount = $format($item['amount'] ?? 0, $unit);
|
||||
$order_number = trim((string) ($item['order_number'] ?? ''));
|
||||
$order_number = $order_number !== '' ? $order_number : __('订单编号未知', 'aksrt');
|
||||
$order_number = $order_number !== '' ? $order_number : __('流水号未知', 'aksrt');
|
||||
$post = get_post((int) ($item['post_id'] ?? 0));
|
||||
$source = $post instanceof WP_Post && $post->post_type === 'post'
|
||||
? get_the_title($post)
|
||||
|
||||
@@ -62,9 +62,9 @@ $status_options = [
|
||||
</header>
|
||||
|
||||
<form class="aksrt-orders-page__search" data-aksrt-orders-search>
|
||||
<label class="screen-reader-text" for="aksrt-order-number"><?php esc_html_e('按订单号查找', 'aksrt'); ?></label>
|
||||
<label class="screen-reader-text" for="aksrt-order-number"><?php esc_html_e('按流水号查找', 'aksrt'); ?></label>
|
||||
<i class="fa fas fa-search" aria-hidden="true"></i>
|
||||
<input id="aksrt-order-number" value="<?php echo esc_attr($order_number); ?>" maxlength="32" placeholder="<?php esc_attr_e('输入订单号开头快速查找', 'aksrt'); ?>">
|
||||
<input id="aksrt-order-number" value="<?php echo esc_attr($order_number); ?>" maxlength="32" placeholder="<?php esc_attr_e('输入流水号开头快速查找', 'aksrt'); ?>">
|
||||
<button class="btn-primary" type="submit"><?php esc_html_e('查找', 'aksrt'); ?></button>
|
||||
<button class="aksrt-orders-page__filter-toggle" type="button" data-aksrt-orders-filter-toggle aria-expanded="false" aria-controls="aksrt-orders-filter-panel"><i class="fa fas fa-sliders-h" aria-hidden="true"></i> <?php esc_html_e('筛选', 'aksrt'); ?></button>
|
||||
</form>
|
||||
@@ -112,7 +112,7 @@ $status_options = [
|
||||
<div class="aksrt-orders-page__card-rail"><span><?php echo esc_html((string) ($order['product_type_label'] ?? '')); ?></span><time><?php echo esc_html((string) ($order['created_at'] ?? '')); ?></time><span class="aksrt-orders-page__card-status is-<?php echo esc_attr((string) ($order['status_group'] ?? '')); ?>"><?php echo esc_html((string) ($order['status_label'] ?? '')); ?></span></div>
|
||||
<div class="aksrt-orders-page__card-main">
|
||||
<?php if (!empty($order['image'])) : ?><img class="aksrt-orders-page__card-img" src="<?php echo esc_url((string) $order['image']); ?>" alt=""><?php else : ?><div class="aksrt-orders-page__card-art" aria-hidden="true"><i class="fa fas fa-book"></i></div><?php endif; ?>
|
||||
<div class="aksrt-orders-page__card-copy"><h3><?php echo esc_html((string) ($order['product_name'] ?? __('订单', 'aksrt'))); ?></h3><p><?php printf(esc_html__('订单号 %s', 'aksrt'), esc_html($number)); ?></p></div>
|
||||
<div class="aksrt-orders-page__card-copy"><h3><?php echo esc_html((string) ($order['product_name'] ?? __('订单', 'aksrt'))); ?></h3><p><?php printf(esc_html__('流水号 %s', 'aksrt'), esc_html($number)); ?></p></div>
|
||||
<div class="aksrt-orders-page__card-value"><strong><?php echo $amount; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong><span><?php esc_html_e('实付', 'aksrt'); ?></span></div>
|
||||
</div>
|
||||
<footer class="aksrt-orders-page__card-actions">
|
||||
|
||||
Reference in new issue
Block a user