feat(pay): 添加充值功能

- 新增 RechargeCmd 类用于处理充值命令
- 新增 RechargeDto 类用于表示充值交易数据
- 新增 OrderAction、OrderStatus 和 PayType 枚举类
- 新增 OrderRepoInterface接口和 OrderRepo 实现类,用于处理订单相关操作
- 更新 ConfigProvider,添加新依赖项
- 新增 CreateRechargeOrderTest 测试用例
This commit is contained in:
李东云
2025-08-18 19:12:07 +08:00
parent ca6000a5c8
commit 80dc1a3706
12 changed files with 267 additions and 2 deletions

View File

@@ -43,4 +43,4 @@ it('should can query EMA products', function () {
->and($products->getRenew())->toBeInstanceOf(ProductItem::class),
)
->and($products->getPlans())->each->toBeInstanceOf(ProductItem::class);
})->only();
});

View File

@@ -0,0 +1,26 @@
<?php
/**
* CreateRechargeOrderTest.php@Pay
*
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
* Powered by PhpStorm
* Created on 2025/8/18
*/
use Singularity\HDK\Pay\Application\Dto\Transaction\RechargeDto;
use Singularity\HDK\Pay\Infrastructure\Repository\OrderRepo;
use function Hyperf\Support\make;
it('should can create recharge order', function () {
$uid = 'cn3321';
$items = [
'product_id' => 1,
'quantity' => 2,
];
$repo = make(OrderRepo::class);
$result = $repo->recharge($uid, [$items]);
expect($result)->toBeInstanceOf(RechargeDto::class);
});

View File

@@ -34,6 +34,7 @@ $container = ApplicationContext::setContainer($container);
/** @var Config $config */
$config = make(Config::class, [
[
'app_name' => 'LuxDesign',
'dependencies' => [],
'payment' => [
'base_uri' => env('LUX_PAY_BASE_URI', 'http://test-pay.luxcreo.com'),