mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 03:35:06 +08:00
feat(pay): 添加充值功能
- 新增 RechargeCmd 类用于处理充值命令 - 新增 RechargeDto 类用于表示充值交易数据 - 新增 OrderAction、OrderStatus 和 PayType 枚举类 - 新增 OrderRepoInterface接口和 OrderRepo 实现类,用于处理订单相关操作 - 更新 ConfigProvider,添加新依赖项 - 新增 CreateRechargeOrderTest 测试用例
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
26
tests/Feature/Transaction/CreateRechargeOrderTest.php
Normal file
26
tests/Feature/Transaction/CreateRechargeOrderTest.php
Normal 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);
|
||||
});
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user