From 9052dc2d4347f806d5c4b1705d163522e719ef31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=9C=E4=BA=91?= Date: Tue, 25 Jul 2023 17:04:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(goods):=20=E4=BF=AE=E5=A4=8D=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Resource/Goods.php | 3 ++- src/Sdk/GoodsRpc.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Resource/Goods.php b/src/Resource/Goods.php index b3cf7f1..a7e45ed 100644 --- a/src/Resource/Goods.php +++ b/src/Resource/Goods.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Singularity\HDK\Pay\Resource; use Hyperf\Resource\Json\JsonResource; +use Money\Currency; use Money\Money; /** @@ -39,7 +40,7 @@ final class Goods extends JsonResource 'id' => $this->id, 'goodsName' => $this->goodsName, 'goodsSpec' => $this->goodsSpec, - 'amount' => new Money($this->amount['price'], $this->amount['currency']) + 'amount' => new Money($this->amount['price'], new Currency($this->amount['currency'])) ]; } diff --git a/src/Sdk/GoodsRpc.php b/src/Sdk/GoodsRpc.php index 01147dd..7814646 100644 --- a/src/Sdk/GoodsRpc.php +++ b/src/Sdk/GoodsRpc.php @@ -48,6 +48,6 @@ final class GoodsRpc $response = $this->requestService->requestGet("/rpc/v1/goods/$goodsId/search", $specifies); $content = $response->getBody()->getContents(); - return Goods::make(Json::decode($content, false)); + return Goods::make(Json::decode($content)); } } \ No newline at end of file