feat: 新增充值退款功能完整实现
- 新增充值退款数据库表结构及相关枚举字段 - 新增充值退款服务层核心逻辑(创建、审核、退款、回调处理) - 新增充值退款后台管理页面及操作入口 - 新增充值退款前端页面及样式调整 - 新增充值退款相关测试用例 - 新增充值退款策略校验及网关处理逻辑
这个提交包含在:
13
tests/recharge_refund_policy.php
普通文件
13
tests/recharge_refund_policy.php
普通文件
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
define('APP_PATH', __DIR__ . '/../server/application/');
|
||||
require __DIR__ . '/../server/thinkphp/base.php';
|
||||
\think\App::initCommon();
|
||||
use app\common\library\RechargeRefundPolicy;
|
||||
function expectInvalid($f) { try { $f(); } catch (InvalidArgumentException $e) { return; } throw new RuntimeException('Expected validation failure'); }
|
||||
if (RechargeRefundPolicy::validateAmount('70.00', '100.00', '30.00', '70.00') !== 7000) throw new RuntimeException('valid amount rejected');
|
||||
expectInvalid(function () { RechargeRefundPolicy::validateAmount('70.01', '100.00', '30.00', '100.00'); });
|
||||
expectInvalid(function () { RechargeRefundPolicy::validateAmount('70.01', '100.00', '0.00', '70.00'); });
|
||||
expectInvalid(function () { RechargeRefundPolicy::validateAmount('0.001', '100.00', '0.00', '100.00'); });
|
||||
expectInvalid(function () { RechargeRefundPolicy::validateAmount('0', '100.00', '0.00', '100.00'); });
|
||||
expectInvalid(function () { RechargeRefundPolicy::validateAmount('1e1', '100.00', '0.00', '100.00'); });
|
||||
echo "Recharge refund amount policy passed\n";
|
||||
在新工单中引用
屏蔽一个用户