mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 07:15:06 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a40b3b219 | ||
|
|
86f375b18a | ||
|
|
8a70e35de7 | ||
|
|
06a198714e | ||
|
|
c2358ae19b |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,4 +1,19 @@
|
||||
# 版本更新日志
|
||||
### [1.5.3](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.5.2...v1.5.3) (2025-09-04)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **invoice:** 重构发票创建流程和积分日志接口 ([8a70e35](http://124.126.16.154:8888/singularity/hdk-pay/commit/8a70e35de72d269bbbd0b5e05c3fa4bccdf1878c))
|
||||
* **PointLogRepo:** 优化 getList 方法参数类型 ([86f375b](http://124.126.16.154:8888/singularity/hdk-pay/commit/86f375b18a0c3213e405b6fcaec20224979dd991))
|
||||
|
||||
### [1.5.2](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.5.1...v1.5.2) (2025-09-02)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **AccountBalanceRepo:** 修复积分余额过期时间解析 ([c2358ae](http://124.126.16.154:8888/singularity/hdk-pay/commit/c2358ae19b072dc0f84a76949ce748f9ce15da4f))
|
||||
|
||||
### [1.5.1](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.5.0...v1.5.1) (2025-09-01)
|
||||
|
||||
|
||||
|
||||
@@ -70,5 +70,5 @@
|
||||
"url": "https://mirrors.aliyun.com/composer/"
|
||||
}
|
||||
},
|
||||
"version": "1.5.1"
|
||||
"version": "1.5.3"
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace Singularity\HDK\Pay\Application\Command;
|
||||
|
||||
final readonly class CreateInvoiceCmd {
|
||||
public function __construct(
|
||||
public string $uid,
|
||||
public string $caseId,
|
||||
public bool $setFreqInvAddr,
|
||||
public string $receiver,
|
||||
|
||||
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Infrastructure\Repository;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Codec\Json;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\Account\AccountBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\Account\PointsBalance;
|
||||
@@ -41,7 +42,7 @@ final class AccountBalanceRepo extends AbstractRepo implements AccountRepoInterf
|
||||
cost: $pointBalance['cost'],
|
||||
amount: $pointBalance['amount'],
|
||||
version: $pointBalance['version'],
|
||||
expiredAt: $pointBalance['expired_at'],
|
||||
expiredAt: isset($pointBalance['expired_at']) ? new Carbon($pointBalance['expired_at']): null,
|
||||
),
|
||||
array: $result['point_balance'],
|
||||
),
|
||||
@@ -63,7 +64,7 @@ final class AccountBalanceRepo extends AbstractRepo implements AccountRepoInterf
|
||||
cost: $result['cost'],
|
||||
amount: $result['amount'],
|
||||
version: $result['version'],
|
||||
expiredAt: $result['expired_at'],
|
||||
expiredAt: isset($result['expired_at']) ? new Carbon($result['expired_at']): null,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ final class InvoiceRepo extends AbstractRepo implements InvoiceRepoInterface
|
||||
public function create(CreateInvoiceCmd $cmd): Invoice
|
||||
{
|
||||
$response = $this->requestService->requestPost(
|
||||
url: "/rpc/v2/account/$cmd->uid/logs/points/$cmd->caseId/invoices",
|
||||
url: "/rpc/v2/account/logs/points/$cmd->caseId/invoices",
|
||||
data: [
|
||||
'set_freq_addr' => $cmd->setFreqInvAddr,
|
||||
'receiver' => $cmd->receiver,
|
||||
|
||||
@@ -14,13 +14,15 @@ namespace Singularity\HDK\Pay\Infrastructure\Repository;
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Codec\Json;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\PointLog\PointLog;
|
||||
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
||||
use Singularity\HDK\Pay\Domain\Account\Repository\PointLogRepoInterface;
|
||||
|
||||
final class PointLogRepo extends AbstractRepo implements PointLogRepoInterface
|
||||
{
|
||||
public function getList(string $uid): array
|
||||
public function getList(string $uid, ?PointType $type = null): array
|
||||
{
|
||||
$response = $this->requestService->requestGet(url: "/rpc/v2/account/$uid/logs/points");
|
||||
$type = isset($type) ? $type->value: 'all';
|
||||
$response = $this->requestService->requestGet(url: "/rpc/v2/account/$uid/balance/$type/logs");
|
||||
|
||||
$content = $response->getBody()->getContents();
|
||||
$result = Json::decode($content);
|
||||
|
||||
@@ -19,7 +19,6 @@ it('should can create invoice', function () {
|
||||
|
||||
$invoice = $repo->create(
|
||||
new CreateInvoiceCmd(
|
||||
uid: '61dbe752d4caa',
|
||||
caseId: '68affb136c01d',
|
||||
setFreqInvAddr: true,
|
||||
receiver: "dongyun.li@luxcreo.ai",
|
||||
|
||||
@@ -29,7 +29,7 @@ test('能够正常创建 Stripe 订单', function () {
|
||||
service: 1
|
||||
);
|
||||
expect($order)->toBeInstanceOf(Order::class);
|
||||
});
|
||||
})->skip();
|
||||
|
||||
test('能够正常获取 Stripe 配置信息', function () {
|
||||
/** @var StripeRpc $service */
|
||||
@@ -40,4 +40,4 @@ test('能够正常获取 Stripe 配置信息', function () {
|
||||
->toBeInstanceOf(StripeConfiguration::class)
|
||||
->toHaveKeys(['id', 'pk'])
|
||||
->and($configures->resolve())->toBeArray();
|
||||
});
|
||||
})->skip();
|
||||
|
||||
Reference in New Issue
Block a user