Compare commits

...

7 Commits

Author SHA1 Message Date
ch4o5
1dba3b84a4 chore(release): 1.0.0-alpha.6 2023-09-22 08:15:10 +00:00
李东云
6cecc96c5f build(composer): 兼容 hyperf 的 RequestInterface 2023-09-22 16:15:01 +08:00
ch4o5
448569583c chore(release): 1.0.0-alpha.5 2023-09-22 07:43:53 +00:00
李东云
99af043376 feat(stripe): 增加 callback 对请求的转化 2023-09-22 15:42:22 +08:00
李东云
90dde97bc9 build(composer): 增加 hyperf/contract 包,更新依赖 2023-09-22 15:39:42 +08:00
ch4o5
f7e1386c78 chore(release): 1.0.0-alpha.4 2023-09-20 08:43:10 +00:00
李东云
a6b33ed0ab docs(resource): 更新了资源的字段注释 2023-09-20 16:43:00 +08:00
6 changed files with 547 additions and 122 deletions

View File

@@ -1,4 +1,30 @@
# 版本更新日志
## [1.0.0-alpha.6](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2023-09-22)
### 📦‍ Build System | 打包构建
* **composer:** 兼容 hyperf 的 RequestInterface ([6cecc96](http://124.126.16.154:8888/singularity/hdk-pay/commit/6cecc96c5ffc223a1a72df6abd1f07d54cb7953d))
## [1.0.0-alpha.5](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2023-09-22)
### 📦‍ Build System | 打包构建
* **composer:** 增加 hyperf/contract 包,更新依赖 ([90dde97](http://124.126.16.154:8888/singularity/hdk-pay/commit/90dde97bc90d33917eb2c1a4d09779dd45776d30))
### ✨ Features | 新功能
* **stripe:** 增加 callback 对请求的转化 ([99af043](http://124.126.16.154:8888/singularity/hdk-pay/commit/99af043376c4b44412a275d1b778e3e3584f5f96))
## [1.0.0-alpha.4](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2023-09-20)
### ✏️ Documentation | 文档
* **resource:** 更新了资源的字段注释 ([a6b33ed](http://124.126.16.154:8888/singularity/hdk-pay/commit/a6b33ed0abed2d23b041407c0a6a58e8405e075c))
## [1.0.0-alpha.3](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2023-09-20)

View File

@@ -20,8 +20,10 @@
"moneyphp/money": "^4.1",
"singularity/hdk-core": "^1.0.0",
"hyperf/contract": "~3.0.0",
"hyperf/constants": "3.0.*",
"hyperf/config": "~3.0.0",
"hyperf/di": "~3.0.0"
"hyperf/di": "~3.0.0",
"hyperf/http-server": "3.0.*"
},
"require-dev": {
"cooper/hyperf-pest": "^1.1",
@@ -61,5 +63,5 @@
"url": "https://mirrors.cloud.tencent.com/composer/"
}
},
"version": "1.0.0-alpha.3"
"version": "1.0.0-alpha.6"
}

611
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,13 @@ namespace Singularity\HDK\Pay\Resource;
use Hyperf\Resource\Json\ResourceCollection;
/**
* Singularity\HDK\Pay\Resource\ GoodsCollection@Pay
*
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
* Powered by PhpStorm
* Created on 2023/9/20
*/
final class GoodsCollection extends ResourceCollection
{
public ?string $wrap = null;

View File

@@ -12,6 +12,14 @@ use Singularity\HDK\Pay\Enum\OrderStatus;
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
* Powered by PhpStorm
* Created on 2023/9/19
*
* @property-read string $orderNo
* @property-read string transactionId
* @property-read Money amount
* @property-read OrderStatus state
* @property-read string uid
* @property-read string payment
* @property-read string remark
*/
class Order extends JsonResource
{
@@ -23,8 +31,8 @@ class Order extends JsonResource
* @return array{
* orderNo: string,
* transactionId: string,
* amount: array{amount: numeric, currency: string},
* state: string,
* amount: Money,
* state: OrderStatus,
* uid: string,
* payment: string,
* remark: string

View File

@@ -14,11 +14,11 @@ namespace Singularity\HDK\Pay\Sdk;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\RequestOptions;
use Hyperf\Codec\Json;
use Hyperf\HttpServer\Contract\RequestInterface;
use Money\Money;
use Singularity\HDK\Core\Http\RequestService;
use Singularity\HDK\Core\Http\RequestServiceFactory;
use Singularity\HDK\Pay\Resource\Order;
use Singularity\HDK\Pay\Resource\StripeConfiguration;
use function Hyperf\Config\config;
@@ -86,4 +86,9 @@ final class StripeRpc
$order = Json::decode($content);
return Order::make($order);
}
public function callback(RequestInterface $request): Order
{
return Order::make($request->post());
}
}