diff --git a/src/Application/Command/CreateInvoiceCmd.php b/src/Application/Command/CreateInvoiceCmd.php index 3897380..82ed3f9 100644 --- a/src/Application/Command/CreateInvoiceCmd.php +++ b/src/Application/Command/CreateInvoiceCmd.php @@ -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, diff --git a/src/Infrastructure/Repository/InvoiceRepo.php b/src/Infrastructure/Repository/InvoiceRepo.php index e0105d1..82b7578 100644 --- a/src/Infrastructure/Repository/InvoiceRepo.php +++ b/src/Infrastructure/Repository/InvoiceRepo.php @@ -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, diff --git a/src/Infrastructure/Repository/PointLogRepo.php b/src/Infrastructure/Repository/PointLogRepo.php index 55df7d5..60a28e5 100644 --- a/src/Infrastructure/Repository/PointLogRepo.php +++ b/src/Infrastructure/Repository/PointLogRepo.php @@ -18,9 +18,10 @@ 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, ?string $type = null): array { - $response = $this->requestService->requestGet(url: "/rpc/v2/account/$uid/logs/points"); + $type ??= 'all'; + $response = $this->requestService->requestGet(url: "/rpc/v2/account/$uid/balance/$type/logs"); $content = $response->getBody()->getContents(); $result = Json::decode($content); diff --git a/tests/Feature/Invoice/CreateInvoiceTest.php b/tests/Feature/Invoice/CreateInvoiceTest.php index 0d78bb5..ceeb58a 100644 --- a/tests/Feature/Invoice/CreateInvoiceTest.php +++ b/tests/Feature/Invoice/CreateInvoiceTest.php @@ -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", diff --git a/tests/Unit/StripeTest.php b/tests/Unit/StripeTest.php index 0583f9a..ca3c62f 100644 --- a/tests/Unit/StripeTest.php +++ b/tests/Unit/StripeTest.php @@ -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();