mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 07:15:06 +08:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06a198714e | ||
|
|
c2358ae19b | ||
|
|
5a4edf9258 | ||
|
|
d17a67f58e | ||
|
|
23aa9b68bf | ||
|
|
48f44f4c4c | ||
|
|
25612823a5 | ||
|
|
c8681a6d54 | ||
|
|
c8f3acd62b | ||
|
|
d3b861a7f7 | ||
|
|
630d4ba7a4 | ||
|
|
b3317c5f8d | ||
|
|
66a468e702 | ||
|
|
dd212ad8a2 | ||
|
|
0d4f561ef0 | ||
|
|
aa8742923c | ||
|
|
738d225fd8 | ||
|
|
38ce644c73 | ||
|
|
f2a51fa1da | ||
|
|
59b5118b93 | ||
|
|
c468fdda0e | ||
|
|
24709acf09 | ||
|
|
f141989a8d | ||
|
|
fd6548e144 | ||
|
|
acc3121320 | ||
|
|
b521e7c9e0 | ||
|
|
2276885ac1 | ||
|
|
8d2d3c8ba5 | ||
|
|
86939ea421 | ||
|
|
960e3f1877 | ||
|
|
2ea5227185 | ||
|
|
c7f94bb396 | ||
|
|
9d61106e2e | ||
|
|
c3a256cb3d |
@@ -17,6 +17,8 @@ jobs:
|
||||
ls ${{ gitea.workspace }}
|
||||
- name: Zip files in the repository
|
||||
run: |
|
||||
sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list
|
||||
sed -i 's|security.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list
|
||||
apt-get update
|
||||
apt-get install zip
|
||||
zip -r dist.zip *
|
||||
|
||||
116
CHANGELOG.md
116
CHANGELOG.md
@@ -1,4 +1,120 @@
|
||||
# 版本更新日志
|
||||
### [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)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **RechargeProductRepoInterface:** 添加查找 FTAI 产品的方法 ([d17a67f](http://124.126.16.154:8888/singularity/hdk-pay/commit/d17a67f58ee2772191e30eb52c09923f43425989))
|
||||
|
||||
## [1.5.0](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.4.1...v1.5.0) (2025-09-01)
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **product:** 支持查询 FTAI 产品 ([48f44f4](http://124.126.16.154:8888/singularity/hdk-pay/commit/48f44f4c4ceef95e7315ce52924ea3729f8214f5))
|
||||
|
||||
### [1.4.1](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.4.0...v1.4.1) (2025-08-29)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **invoice:** 移除 getCaseProduct 方法中未使用的参数 ([c8681a6](http://124.126.16.154:8888/singularity/hdk-pay/commit/c8681a6d5445b8b9177a236e41aee25d63d50315))
|
||||
|
||||
## [1.4.0](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.3.1...v1.4.0) (2025-08-28)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **invoice:** 更新 InvoiceProduct 类的位置 ([66a468e](http://124.126.16.154:8888/singularity/hdk-pay/commit/66a468e702a0b550ce7445c66164b10b4edcc41a))
|
||||
* **invoice:** 重构发票相关类的命名空间 ([630d4ba](http://124.126.16.154:8888/singularity/hdk-pay/commit/630d4ba7a427bc7bece24093f783634d3e707b2f))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **invoice:** 新增发票商品查询功能 ([dd212ad](http://124.126.16.154:8888/singularity/hdk-pay/commit/dd212ad8a26f03f2b6e204e5485120e267ba73a2))
|
||||
* **invoice:** 添加创建发票功能 ([b3317c5](http://124.126.16.154:8888/singularity/hdk-pay/commit/b3317c5f8d65aae811130f4af9d09cce514047ff))
|
||||
* **invoice:** 添加查询用户常用发票地址功能 ([d3b861a](http://124.126.16.154:8888/singularity/hdk-pay/commit/d3b861a7f75281168ec16562aec290f1904fda7e))
|
||||
|
||||
### [1.3.1](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.3.0...v1.3.1) (2025-08-27)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **account:** 优化点数日志仓库接口和实现类 ([aa87429](http://124.126.16.154:8888/singularity/hdk-pay/commit/aa8742923c38ae90386c83b8a280a47dacc3537b))
|
||||
|
||||
## [1.3.0](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.2.7...v1.3.0) (2025-08-27)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **Account:** 重构账户相关类的命名空间 ([f2a51fa](http://124.126.16.154:8888/singularity/hdk-pay/commit/f2a51fa1da67d5169761bc47cbe2b6da605051ae))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **account:** 添加积分日志相关功能 ([38ce644](http://124.126.16.154:8888/singularity/hdk-pay/commit/38ce644c7351740641901a0497351f45c0119339))
|
||||
|
||||
### [1.2.7](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.2.6...v1.2.7) (2025-08-26)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* 更新发布流程以使用阿里云镜像源 ([c468fdd](http://124.126.16.154:8888/singularity/hdk-pay/commit/c468fdda0e4fd8bf5b2253527b368362ccb81954))
|
||||
|
||||
### [1.2.6](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.2.5...v1.2.6) (2025-08-26)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **Order:** 重构订单资源以支持经典订单解析 ([f141989](http://124.126.16.154:8888/singularity/hdk-pay/commit/f141989a8d7c6055d0d740619cc0660a1ea0ef7f))
|
||||
|
||||
### [1.2.5](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.2.4...v1.2.5) (2025-08-26)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **Sdk:** 调整 WechatRpc 类中数组键名的命名风格 ([acc3121](http://124.126.16.154:8888/singularity/hdk-pay/commit/acc3121320d74e2ea3423e3502779afde9675ee8))
|
||||
|
||||
### [1.2.4](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.2.3...v1.2.4) (2025-08-21)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **transaction:** 修改交易项中的价格字段名称 ([2276885](http://124.126.16.154:8888/singularity/hdk-pay/commit/2276885ac1759a330eb6fb73e1158235edcac941))
|
||||
|
||||
### [1.2.3](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.2.2...v1.2.3) (2025-08-20)
|
||||
|
||||
|
||||
### ♻️ Code Refactoring | 代码重构
|
||||
|
||||
* **transaction:** 重构交易信息构建方式 ([86939ea](http://124.126.16.154:8888/singularity/hdk-pay/commit/86939ea421d2f14c621da4e3bb86e3ab8d8b7d33))
|
||||
|
||||
### [1.2.2](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.2.1...v1.2.2) (2025-08-20)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes | Bug 修复
|
||||
|
||||
* **transaction:** 修复回调服务中的商品价格字段 ([2ea5227](http://124.126.16.154:8888/singularity/hdk-pay/commit/2ea52271852e4e009b044fb9baeb222b3a54c111))
|
||||
|
||||
### [1.2.1](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.2.0...v1.2.1) (2025-08-20)
|
||||
|
||||
|
||||
### 📦 Build System | 打包构建
|
||||
|
||||
* **deps:** 更新多个依赖至最新版本 ([c3a256c](http://124.126.16.154:8888/singularity/hdk-pay/commit/c3a256cb3d5e41a29a4969442b5a7f27c9000576))
|
||||
|
||||
|
||||
### ✨ Features | 新功能
|
||||
|
||||
* **TransactionRecord:** 添加 TransactionRecord 类的 getter 方法 ([9d61106](http://124.126.16.154:8888/singularity/hdk-pay/commit/9d61106e2e8b04559fb34b606fb489a2890c34d5))
|
||||
|
||||
## [1.2.0](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.1.0...v1.2.0) (2025-08-20)
|
||||
|
||||
|
||||
|
||||
@@ -70,5 +70,5 @@
|
||||
"url": "https://mirrors.aliyun.com/composer/"
|
||||
}
|
||||
},
|
||||
"version": "1.2.0"
|
||||
"version": "1.5.2"
|
||||
}
|
||||
|
||||
133
composer.lock
generated
133
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "1502e30908a8b64e02da6b75783f3598",
|
||||
"content-hash": "842b9afd4b54f12687b614b3d52a7b77",
|
||||
"packages": [
|
||||
{
|
||||
"name": "carbonphp/carbon-doctrine-types",
|
||||
@@ -942,16 +942,16 @@
|
||||
},
|
||||
{
|
||||
"name": "ergebnis/http-method",
|
||||
"version": "2.5.0",
|
||||
"version": "2.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ergebnis/http-method.git",
|
||||
"reference": "cb034b68d82e21b8a3cd4062426d3c28ced32d2c"
|
||||
"reference": "e8dd54f942095fdbc5678fac193c4940710a2fba"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ergebnis/http-method/zipball/cb034b68d82e21b8a3cd4062426d3c28ced32d2c",
|
||||
"reference": "cb034b68d82e21b8a3cd4062426d3c28ced32d2c",
|
||||
"url": "https://api.github.com/repos/ergebnis/http-method/zipball/e8dd54f942095fdbc5678fac193c4940710a2fba",
|
||||
"reference": "e8dd54f942095fdbc5678fac193c4940710a2fba",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@@ -961,20 +961,27 @@
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": "~8.1.0 || ~8.2.0 || ~8.3.0"
|
||||
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ergebnis/composer-normalize": "^2.39.0",
|
||||
"ergebnis/license": "^2.3.0",
|
||||
"ergebnis/php-cs-fixer-config": "^6.12.0",
|
||||
"ergebnis/phpunit-slow-test-detector": "^2.4.0",
|
||||
"phpunit/phpunit": "^10.4.2",
|
||||
"psalm/plugin-phpunit": "~0.18.4",
|
||||
"rector/rector": "~0.18.11",
|
||||
"vimeo/psalm": "^5.16.0"
|
||||
"ergebnis/composer-normalize": "^2.44.0",
|
||||
"ergebnis/license": "^2.6.0",
|
||||
"ergebnis/php-cs-fixer-config": "^6.37.0",
|
||||
"ergebnis/phpunit-slow-test-detector": "^2.16.1",
|
||||
"phpstan/extension-installer": "^1.4.3",
|
||||
"phpstan/phpstan": "^1.12.10",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.2.1",
|
||||
"phpstan/phpstan-phpunit": "^1.4.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.6.1",
|
||||
"phpunit/phpunit": "^10.5.26",
|
||||
"rector/rector": "^1.2.10",
|
||||
"roave/backward-compatibility-check": "^8.6.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.6-dev"
|
||||
},
|
||||
"composer-normalize": {
|
||||
"indent-size": 2,
|
||||
"indent-style": "space"
|
||||
@@ -1008,7 +1015,7 @@
|
||||
"security": "https://github.com/ergebnis/http-method/blob/main/.github/SECURITY.md",
|
||||
"source": "https://github.com/ergebnis/http-method"
|
||||
},
|
||||
"time": "2023-11-28T09:50:06+00:00"
|
||||
"time": "2024-11-17T21:27:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fig/http-message-util",
|
||||
@@ -5710,16 +5717,16 @@
|
||||
},
|
||||
{
|
||||
"name": "react/promise",
|
||||
"version": "v2.11.0",
|
||||
"version": "v3.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/reactphp/promise.git",
|
||||
"reference": "1a8460931ea36dc5c76838fec5734d55c88c6831"
|
||||
"reference": "8a164643313c71354582dc850b42b33fa12a4b63"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/reactphp/promise/zipball/1a8460931ea36dc5c76838fec5734d55c88c6831",
|
||||
"reference": "1a8460931ea36dc5c76838fec5734d55c88c6831",
|
||||
"url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63",
|
||||
"reference": "8a164643313c71354582dc850b42b33fa12a4b63",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@@ -5729,10 +5736,11 @@
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4.0"
|
||||
"php": ">=7.1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
|
||||
"phpstan/phpstan": "1.10.39 || 1.4.10",
|
||||
"phpunit/phpunit": "^9.6 || ^7.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -5776,7 +5784,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/reactphp/promise/issues",
|
||||
"source": "https://github.com/reactphp/promise/tree/v2.11.0"
|
||||
"source": "https://github.com/reactphp/promise/tree/v3.2.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -5784,7 +5792,7 @@
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2023-11-16T16:16:50+00:00"
|
||||
"time": "2024-05-24T10:39:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "rector/rector",
|
||||
@@ -6102,16 +6110,16 @@
|
||||
},
|
||||
{
|
||||
"name": "singularity/hdk-core",
|
||||
"version": "1.0.0-beta.14",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://nest.doylee.cn/HDK/hdk-core",
|
||||
"reference": "1.0.0-beta.14"
|
||||
"reference": "1.0.1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://nest.doylee.cn/api/packages/HDK/composer/files/singularity%2Fhdk-core/1.0.0-beta.14/singularity-hdk-core.1.0.0-beta.14.zip",
|
||||
"shasum": "dc0a07b1c83088d3ba2b694de7d11dae9ca8b115"
|
||||
"url": "https://nest.doylee.cn/api/packages/HDK/composer/files/singularity%2Fhdk-core/1.0.1/singularity-hdk-core.1.0.1.zip",
|
||||
"shasum": "b61df9f495b193f441b0e92edf7f8cdeb8d1d038"
|
||||
},
|
||||
"require": {
|
||||
"composer/composer": ">=2.0",
|
||||
@@ -6204,7 +6212,7 @@
|
||||
}
|
||||
],
|
||||
"description": "Common Hyperf Development Kit",
|
||||
"time": "2025-08-12T15:05:30+08:00"
|
||||
"time": "2025-08-20T14:10:21+08:00"
|
||||
},
|
||||
{
|
||||
"name": "swow/psr7-plus",
|
||||
@@ -6662,7 +6670,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
@@ -6727,7 +6735,7 @@
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -6747,7 +6755,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-intl-grapheme",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
|
||||
@@ -6811,7 +6819,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -6831,7 +6839,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-intl-normalizer",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
|
||||
@@ -6898,7 +6906,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -6918,16 +6926,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
|
||||
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
|
||||
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
|
||||
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@@ -6937,6 +6945,7 @@
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"ext-iconv": "*",
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
@@ -6948,8 +6957,8 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
"url": "https://github.com/symfony/polyfill",
|
||||
"name": "symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -6984,7 +6993,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -7000,11 +7009,11 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
"time": "2024-12-23T08:48:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php73",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php73.git",
|
||||
@@ -7066,7 +7075,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -7086,16 +7095,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
|
||||
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
|
||||
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
|
||||
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@@ -7152,7 +7161,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -7168,11 +7177,11 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
"time": "2025-01-02T08:10:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php81",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php81.git",
|
||||
@@ -7234,7 +7243,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -7254,7 +7263,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php82",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php82.git",
|
||||
@@ -7316,7 +7325,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php82/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-php82/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -7336,7 +7345,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php83",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php83.git",
|
||||
@@ -7398,7 +7407,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-php83/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -7418,16 +7427,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php84",
|
||||
"version": "v1.31.0",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php84.git",
|
||||
"reference": "e5493eb51311ab0b1cc2243416613f06ed8f18bd"
|
||||
"reference": "000df7860439609837bbe28670b0be15783b7fbf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/e5493eb51311ab0b1cc2243416613f06ed8f18bd",
|
||||
"reference": "e5493eb51311ab0b1cc2243416613f06ed8f18bd",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/000df7860439609837bbe28670b0be15783b7fbf",
|
||||
"reference": "000df7860439609837bbe28670b0be15783b7fbf",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@@ -7480,7 +7489,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php84/tree/v1.31.0"
|
||||
"source": "https://github.com/symfony/polyfill-php84/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -7496,7 +7505,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T12:04:04+00:00"
|
||||
"time": "2025-02-20T12:04:08+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
|
||||
27
src/Application/Command/CreateInvoiceCmd.php
Normal file
27
src/Application/Command/CreateInvoiceCmd.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* CreateInvoiceCmd.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/29
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
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,
|
||||
public string $patientName,
|
||||
public string $address,
|
||||
public string $city,
|
||||
public string $state,
|
||||
public string $country,
|
||||
public string $zipCode,
|
||||
) {}
|
||||
}
|
||||
@@ -43,28 +43,36 @@ final class RechargeProductsDto extends AbstractDto
|
||||
$effect = $product->effect;
|
||||
$price = $product->unitPrice;
|
||||
|
||||
return [
|
||||
$result = [
|
||||
'id' => $product->id,
|
||||
'name' => $product->description,
|
||||
'currency' => $price->getCurrency()->getCode(),
|
||||
'price' => (float)$price->getAmount(),
|
||||
'total_points' => $effect->getPointTotal(),
|
||||
'bonus_rate_pct' => (float)(bcmul(
|
||||
num1: $effect->getPointTotal() == 0
|
||||
? '0'
|
||||
: bcdiv(
|
||||
(string)$effect->pointBonus,
|
||||
(string)$effect->getPointTotal(),
|
||||
3,
|
||||
),
|
||||
num2: '100',
|
||||
scale: 0,
|
||||
)),
|
||||
'point' => [
|
||||
'total' => $effect->getPointTotal(),
|
||||
'number' => $effect->pointBasic,
|
||||
'bonus' => $effect->pointBonus,
|
||||
],
|
||||
'price' => (float)bcdiv($price->getAmount(), '100', 2),
|
||||
];
|
||||
|
||||
$is_ftai = empty($effect);
|
||||
if (!$is_ftai) {
|
||||
$result += [
|
||||
'total_points' => $effect->getPointTotal(),
|
||||
'bonus_rate_pct' => (float)(bcmul(
|
||||
num1: $effect->getPointTotal() == 0
|
||||
? '0'
|
||||
: bcdiv(
|
||||
(string)$effect->pointBonus,
|
||||
(string)$effect->getPointTotal(),
|
||||
3,
|
||||
),
|
||||
num2: '100',
|
||||
scale: 0,
|
||||
)),
|
||||
'point' => [
|
||||
'total' => $effect->getPointTotal(),
|
||||
'number' => $effect->pointBasic,
|
||||
'bonus' => $effect->pointBonus,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,19 @@ namespace Singularity\HDK\Pay;
|
||||
use Hyperf\Contract\StdoutLoggerInterface;
|
||||
use Hyperf\Framework\Logger\StdoutLogger;
|
||||
use Singularity\HDK\Pay\Domain\Account\Repository\AccountRepoInterface;
|
||||
use Singularity\HDK\Pay\Domain\Account\Repository\PointLogRepoInterface;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Repository\FrequentAddressRepoInterface;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Repository\InvoiceProductRepoInterface;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Repository\InvoiceRepoInterface;
|
||||
use Singularity\HDK\Pay\Domain\Product\Repository\ExchangeRepoInterface;
|
||||
use Singularity\HDK\Pay\Domain\Product\Repository\RechargeProductRepoInterface;
|
||||
use Singularity\HDK\Pay\Domain\Transaction\Repository\OrderRepoInterface;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\AccountBalanceRepo;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\FrequentAddressRepo;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\InvoiceProductRepo;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\InvoiceRepo;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\OrderRepo;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\PointLogRepo;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\ProductRepo;
|
||||
|
||||
/**
|
||||
@@ -30,11 +38,22 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
StdoutLoggerInterface::class => StdoutLogger::class,
|
||||
|
||||
// Command
|
||||
// Repo
|
||||
// account
|
||||
AccountRepoInterface::class => AccountBalanceRepo::class,
|
||||
PointLogRepoInterface::class => PointLogRepo::class,
|
||||
|
||||
// product
|
||||
ExchangeRepoInterface::class => ProductRepo::class,
|
||||
RechargeProductRepoInterface::class => ProductRepo::class,
|
||||
|
||||
// transaction
|
||||
OrderRepoInterface::class => OrderRepo::class,
|
||||
|
||||
// invoice
|
||||
InvoiceProductRepoInterface::class => InvoiceProductRepo::class,
|
||||
InvoiceRepoInterface::class => InvoiceRepo::class,
|
||||
FrequentAddressRepoInterface::class => FrequentAddressRepo::class,
|
||||
],
|
||||
// 合并到 config/autoload/annotations.php 文件
|
||||
'annotations' => [
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Account\Aggregate;
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\ValueObject\PointsBalance;
|
||||
namespace Singularity\HDK\Pay\Domain\Account\Aggregate\Account;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Pay\Domain\Account\Aggregate\AccountBalance@Pay
|
||||
@@ -27,7 +25,7 @@ final readonly class AccountBalance
|
||||
{
|
||||
/**
|
||||
* @param string $uid
|
||||
* @param TPointsBalances $pointsBalances
|
||||
* @param PointsBalance $pointsBalances
|
||||
*/
|
||||
public function __construct(
|
||||
private string $uid,
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Account\Aggregate\ValueObject;
|
||||
namespace Singularity\HDK\Pay\Domain\Account\Aggregate\Account;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
||||
70
src/Domain/Account/Aggregate/PointLog/PointLog.php
Normal file
70
src/Domain/Account/Aggregate/PointLog/PointLog.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PointLog.php@LuxPay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/21
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Account\Aggregate\PointLog;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Singularity\HDK\Pay\Domain\AggregateRoot;
|
||||
|
||||
final class PointLog extends AggregateRoot
|
||||
{
|
||||
public function __construct(
|
||||
private readonly int $id,
|
||||
private readonly string $caseId,
|
||||
private readonly string $uid,
|
||||
private readonly float $credits,
|
||||
private readonly string $source,
|
||||
private readonly string $operator,
|
||||
private readonly string $description,
|
||||
private readonly Carbon $date,
|
||||
) {}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function getSource(): string
|
||||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
public function getDate(): Carbon
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function getUid(): string
|
||||
{
|
||||
return $this->uid;
|
||||
}
|
||||
|
||||
|
||||
public function getCredits(): float
|
||||
{
|
||||
return $this->credits;
|
||||
}
|
||||
|
||||
public function getOperator(): string
|
||||
{
|
||||
return $this->operator;
|
||||
}
|
||||
|
||||
public function getCaseId(): ?string
|
||||
{
|
||||
return $this->caseId;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
||||
35
src/Domain/Account/Enum/PointAction.php
Normal file
35
src/Domain/Account/Enum/PointAction.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* PointAction.php@LuxPay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/21
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Account\Enum;
|
||||
|
||||
enum PointAction
|
||||
{
|
||||
case Initial;
|
||||
|
||||
case Deduct;
|
||||
|
||||
case Refund;
|
||||
|
||||
case Increase;
|
||||
|
||||
case Clear;
|
||||
|
||||
public static function tryFrom(string $action): ?PointAction
|
||||
{
|
||||
return match (strtolower($action)) {
|
||||
'initial' => self::Initial,
|
||||
'deduct' => self::Deduct,
|
||||
'refund' => self::Refund,
|
||||
'increase' => self::Increase,
|
||||
'clear' => self::Clear,
|
||||
default => null,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Account\Repository;
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\AccountBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\ValueObject\PointsBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\Account\AccountBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\Account\PointsBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
||||
|
||||
interface AccountRepoInterface
|
||||
|
||||
22
src/Domain/Account/Repository/PointLogRepoInterface.php
Normal file
22
src/Domain/Account/Repository/PointLogRepoInterface.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* PointLogRepoInterface.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/27
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Account\Repository;
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\PointLog\PointLog;
|
||||
|
||||
interface PointLogRepoInterface
|
||||
{
|
||||
/**
|
||||
* @param string $uid
|
||||
* @return PointLog[]
|
||||
*/
|
||||
public function getList(string $uid): array;
|
||||
|
||||
}
|
||||
56
src/Domain/Invoice/Aggregate/Address/FrequentAddress.php
Normal file
56
src/Domain/Invoice/Aggregate/Address/FrequentAddress.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* QueryFreqAddrDto.php@LuxPay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/29
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Invoice\Aggregate\Address;
|
||||
|
||||
use Singularity\HDK\Pay\Domain\AggregateRoot;
|
||||
|
||||
final class FrequentAddress extends AggregateRoot
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $uid,
|
||||
private readonly string $address,
|
||||
private readonly string $city,
|
||||
private readonly string $state,
|
||||
private readonly string $country,
|
||||
private readonly string $zipCode,
|
||||
) {}
|
||||
|
||||
public function getUid(): string
|
||||
{
|
||||
return $this->uid;
|
||||
}
|
||||
|
||||
public function getAddress(): string
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
public function getCity(): string
|
||||
{
|
||||
return $this->city;
|
||||
}
|
||||
|
||||
public function getState(): string
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
public function getCountry(): string
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
|
||||
public function getZipCode(): string
|
||||
{
|
||||
return $this->zipCode;
|
||||
}
|
||||
}
|
||||
53
src/Domain/Invoice/Aggregate/Invoice/Address.php
Normal file
53
src/Domain/Invoice/Aggregate/Invoice/Address.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Address.php@LuxPay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/28
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice;
|
||||
|
||||
final readonly class Address {
|
||||
public function __construct(
|
||||
private string $patientName,
|
||||
private string $address,
|
||||
private string $city,
|
||||
private string $state,
|
||||
private string $country,
|
||||
private string $zipCode,
|
||||
) {}
|
||||
|
||||
public function getPatientName(): string
|
||||
{
|
||||
return $this->patientName;
|
||||
}
|
||||
|
||||
public function getAddress(): string
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
public function getCity(): string
|
||||
{
|
||||
return $this->city;
|
||||
}
|
||||
|
||||
public function getState(): string
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
public function getCountry(): string
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
|
||||
public function getZipCode(): string
|
||||
{
|
||||
return $this->zipCode;
|
||||
}
|
||||
}
|
||||
81
src/Domain/Invoice/Aggregate/Invoice/Invoice.php
Normal file
81
src/Domain/Invoice/Aggregate/Invoice/Invoice.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* InvoiceDto.php@LuxPay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/28
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice;
|
||||
|
||||
use Singularity\HDK\Pay\Domain\AggregateRoot;
|
||||
|
||||
final class Invoice extends AggregateRoot
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $invoiceNo,
|
||||
private readonly string $uid,
|
||||
private readonly string $caseId,
|
||||
private readonly Address $address,
|
||||
private readonly bool $setFreqInvAddr,
|
||||
private readonly string $receiver,
|
||||
) {}
|
||||
|
||||
public function getInvoiceNo(): string
|
||||
{
|
||||
return $this->invoiceNo;
|
||||
}
|
||||
|
||||
public function getUid(): string
|
||||
{
|
||||
return $this->uid;
|
||||
}
|
||||
|
||||
public function getCaseId(): string
|
||||
{
|
||||
return $this->caseId;
|
||||
}
|
||||
|
||||
public function isSetFreqInvAddr(): bool
|
||||
{
|
||||
return $this->setFreqInvAddr;
|
||||
}
|
||||
|
||||
public function getReceiver(): string
|
||||
{
|
||||
return $this->receiver;
|
||||
}
|
||||
|
||||
public function getPatientName(): string
|
||||
{
|
||||
return $this->address->getPatientName();
|
||||
}
|
||||
|
||||
public function getAddress(): string
|
||||
{
|
||||
return $this->address->getAddress();
|
||||
}
|
||||
|
||||
public function getCity(): string
|
||||
{
|
||||
return $this->address->getCity();
|
||||
}
|
||||
|
||||
public function getState(): string
|
||||
{
|
||||
return $this->address->getState();
|
||||
}
|
||||
|
||||
public function getCountry(): string
|
||||
{
|
||||
return $this->address->getCountry();
|
||||
}
|
||||
|
||||
public function getZipCode(): string
|
||||
{
|
||||
return $this->address->getZipCode();
|
||||
}
|
||||
}
|
||||
22
src/Domain/Invoice/Aggregate/Invoice/InvoiceProduct.php
Normal file
22
src/Domain/Invoice/Aggregate/Invoice/InvoiceProduct.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* InvoiceProduct.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/28
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice;
|
||||
|
||||
final readonly class InvoiceProduct {
|
||||
public function __construct(
|
||||
public string $caseId,
|
||||
public string $uid,
|
||||
public string $name,
|
||||
public string $sku,
|
||||
public string $description,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* FrequentAddressRepoInterface.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/29
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Invoice\Repository;
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Address\FrequentAddress;
|
||||
|
||||
interface FrequentAddressRepoInterface
|
||||
{
|
||||
/**
|
||||
* @param string $uid
|
||||
* @return FrequentAddress
|
||||
*/
|
||||
public function findByUser(string $uid): FrequentAddress;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* InvoiceProductRepoInterface.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/28
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Invoice\Repository;
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\InvoiceProduct;
|
||||
|
||||
interface InvoiceProductRepoInterface
|
||||
{
|
||||
/**
|
||||
* @param string $caseId
|
||||
* @return InvoiceProduct
|
||||
*/
|
||||
public function getCaseProduct(string $caseId): InvoiceProduct;
|
||||
}
|
||||
22
src/Domain/Invoice/Repository/InvoiceRepoInterface.php
Normal file
22
src/Domain/Invoice/Repository/InvoiceRepoInterface.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* InvoiceRepoInterface.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/29
|
||||
*/
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Invoice\Repository;
|
||||
|
||||
use Singularity\HDK\Pay\Application\Command\CreateInvoiceCmd;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\Invoice;
|
||||
|
||||
interface InvoiceRepoInterface
|
||||
{
|
||||
/**
|
||||
* @param CreateInvoiceCmd $cmd
|
||||
* @return Invoice
|
||||
*/
|
||||
public function create(CreateInvoiceCmd $cmd): Invoice;
|
||||
}
|
||||
@@ -22,6 +22,6 @@ final class ProductItem
|
||||
public string $description,
|
||||
public Money $unitPrice,
|
||||
public ProductType $productType,
|
||||
public RechargeEffect $effect,
|
||||
public ?RechargeEffect $effect = null,
|
||||
) {}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace Singularity\HDK\Pay\Domain\Product\Repository;
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
||||
use Singularity\HDK\Pay\Domain\Product\Aggregate\RechargeProduct;
|
||||
|
||||
interface RechargeProductRepoInterface
|
||||
@@ -23,4 +24,11 @@ interface RechargeProductRepoInterface
|
||||
* @return RechargeProduct
|
||||
*/
|
||||
public function findEmaProduct(string $uid): RechargeProduct;
|
||||
|
||||
/**
|
||||
* @param string $uid
|
||||
* @param PointType $pointType
|
||||
* @return RechargeProduct
|
||||
*/
|
||||
public function findFtaiProduct(string $uid, PointType $pointType): RechargeProduct;
|
||||
}
|
||||
@@ -54,4 +54,74 @@ final class TransactionRecord extends AggregateRoot
|
||||
private readonly ?Carbon $occurredAt,
|
||||
private readonly ?Carbon $lastRefundedAt,
|
||||
) {}
|
||||
|
||||
public function getOrderNo(): string
|
||||
{
|
||||
return $this->orderNo;
|
||||
}
|
||||
|
||||
public function getUid(): string
|
||||
{
|
||||
return $this->uid;
|
||||
}
|
||||
|
||||
public function getPayType(): PayType
|
||||
{
|
||||
return $this->payType;
|
||||
}
|
||||
|
||||
public function getAction(): OrderAction
|
||||
{
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
public function getStatus(): OrderStatus
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function getSource(): string
|
||||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
public function getItems(): array
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
public function getTransactions(): array
|
||||
{
|
||||
return $this->transactions;
|
||||
}
|
||||
|
||||
public function getRefunds(): array
|
||||
{
|
||||
return $this->refunds;
|
||||
}
|
||||
|
||||
public function getExternal(): ?array
|
||||
{
|
||||
return $this->external;
|
||||
}
|
||||
|
||||
public function getExternalId(): ?string
|
||||
{
|
||||
return $this->externalId;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?Carbon
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
public function getOccurredAt(): ?Carbon
|
||||
{
|
||||
return $this->occurredAt;
|
||||
}
|
||||
|
||||
public function getLastRefundedAt(): ?Carbon
|
||||
{
|
||||
return $this->lastRefundedAt;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ final class Item extends ArrayObject
|
||||
parent::__construct([
|
||||
'name' => $name,
|
||||
'quantity' => $quantity,
|
||||
'price' => $price,
|
||||
'unit_price' => $price,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ abstract class Transaction extends ArrayObject
|
||||
) {
|
||||
parent::__construct(
|
||||
[
|
||||
'pay_type' => $payType,
|
||||
'type' => $type,
|
||||
'pay_type' => $payType->value,
|
||||
'type' => $type->value,
|
||||
'amount' => $amount,
|
||||
'status' => $status,
|
||||
'status' => $status->name,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,9 +11,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Infrastructure\Repository;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Codec\Json;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\AccountBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\ValueObject\PointsBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\Account\AccountBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\Account\PointsBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
||||
use Singularity\HDK\Pay\Domain\Account\Repository\AccountRepoInterface;
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
41
src/Infrastructure/Repository/FrequentAddressRepo.php
Normal file
41
src/Infrastructure/Repository/FrequentAddressRepo.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FrequentAddressRepo.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/29
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Infrastructure\Repository;
|
||||
|
||||
use Hyperf\Codec\Json;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Address\FrequentAddress;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\InvoiceProduct;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Repository\FrequentAddressRepoInterface;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\AbstractRepo;
|
||||
|
||||
final class FrequentAddressRepo extends AbstractRepo implements FrequentAddressRepoInterface
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function findByUser(string $uid): FrequentAddress
|
||||
{
|
||||
$response = $this->requestService->requestGet("/rpc/v2/account/$uid/inv-addr");
|
||||
|
||||
$content = $response->getBody()->getContents();
|
||||
$result = Json::decode($content);
|
||||
|
||||
return new FrequentAddress(
|
||||
uid: $result['uid'],
|
||||
address: $result['address'],
|
||||
city: $result['city'],
|
||||
state: $result['state'],
|
||||
country: $result['country'],
|
||||
zipCode: $result['zip']
|
||||
);
|
||||
}
|
||||
}
|
||||
38
src/Infrastructure/Repository/InvoiceProductRepo.php
Normal file
38
src/Infrastructure/Repository/InvoiceProductRepo.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* InvoiceProductRepo.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/28
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Infrastructure\Repository;
|
||||
|
||||
use Hyperf\Codec\Json;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\InvoiceProduct;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Repository\InvoiceProductRepoInterface;
|
||||
|
||||
final class InvoiceProductRepo extends AbstractRepo implements InvoiceProductRepoInterface
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getCaseProduct(string $caseId): InvoiceProduct
|
||||
{
|
||||
$response = $this->requestService->requestGet("/rpc/v2/invoice/$caseId/product");
|
||||
|
||||
$content = $response->getBody()->getContents();
|
||||
$result = Json::decode($content);
|
||||
|
||||
return new InvoiceProduct(
|
||||
caseId: $result['case_id'],
|
||||
uid: $result['uid'],
|
||||
name: $result['name'],
|
||||
sku: $result['sku'],
|
||||
description: $result['description'],
|
||||
);
|
||||
}
|
||||
}
|
||||
57
src/Infrastructure/Repository/InvoiceRepo.php
Normal file
57
src/Infrastructure/Repository/InvoiceRepo.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* InvoiceRepo.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/29
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Pay\Infrastructure\Repository;
|
||||
|
||||
use Hyperf\Codec\Json;
|
||||
use Singularity\HDK\Pay\Application\Command\CreateInvoiceCmd;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\Address;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\Invoice;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Repository\InvoiceRepoInterface;
|
||||
|
||||
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",
|
||||
data: [
|
||||
'set_freq_addr' => $cmd->setFreqInvAddr,
|
||||
'receiver' => $cmd->receiver,
|
||||
'patient_name' => $cmd->patientName,
|
||||
'address' => $cmd->address,
|
||||
'city' => $cmd->city,
|
||||
'state' => $cmd->state,
|
||||
'country' => $cmd->country,
|
||||
'zip' => $cmd->zipCode,
|
||||
],
|
||||
);
|
||||
|
||||
$content = $response->getBody()->getContents();
|
||||
$result = Json::decode($content);
|
||||
|
||||
return new Invoice(
|
||||
invoiceNo: $result['invoice_no'],
|
||||
uid: $result['uid'],
|
||||
caseId: $result['case_id'],
|
||||
address: new Address(
|
||||
patientName: $result['patient_name'],
|
||||
address: $result['address'],
|
||||
city: $result['city'],
|
||||
state: $result['state'],
|
||||
country: $result['country'],
|
||||
zipCode: $result['zip'],
|
||||
),
|
||||
setFreqInvAddr: $result['set_freq_addr'],
|
||||
receiver: $result['receiver'],
|
||||
);
|
||||
}
|
||||
}
|
||||
41
src/Infrastructure/Repository/PointLogRepo.php
Normal file
41
src/Infrastructure/Repository/PointLogRepo.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PointLogRepo.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/27
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
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\Repository\PointLogRepoInterface;
|
||||
|
||||
final class PointLogRepo extends AbstractRepo implements PointLogRepoInterface
|
||||
{
|
||||
public function getList(string $uid): array
|
||||
{
|
||||
$response = $this->requestService->requestGet(url: "/rpc/v2/account/$uid/logs/points");
|
||||
|
||||
$content = $response->getBody()->getContents();
|
||||
$result = Json::decode($content);
|
||||
|
||||
return array_map(function ($item) {
|
||||
return new PointLog(
|
||||
id: $item['id'],
|
||||
caseId: $item['case_id'],
|
||||
uid: $item['uid'],
|
||||
credits: $item['credits'],
|
||||
source: $item['source'],
|
||||
operator: $item['operator'],
|
||||
description: $item['description'],
|
||||
date: new Carbon($item['date']),
|
||||
);
|
||||
}, $result);
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter
|
||||
id: $result['one_time']['id'],
|
||||
description: $result['one_time']['name'],
|
||||
unitPrice: new Money(
|
||||
amount: $result['one_time']['price'],
|
||||
amount:bcmul((string)$result['one_time']['price'], '100'),
|
||||
currency: new Currency($result['one_time']['currency']),
|
||||
),
|
||||
productType: ProductType::oneTime,
|
||||
@@ -59,7 +59,7 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter
|
||||
id: $item['id'],
|
||||
description: $item['name'],
|
||||
unitPrice: new Money(
|
||||
amount: $item['price'],
|
||||
amount: bcmul((string)$item['price'], '100'),
|
||||
currency: new Currency($item['currency']),
|
||||
),
|
||||
productType: ProductType::pack,
|
||||
@@ -72,6 +72,59 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter
|
||||
);
|
||||
}
|
||||
|
||||
public function findFtaiProduct(string $uid, PointType $pointType): RechargeProduct
|
||||
{
|
||||
$response = $this->requestService->requestGet(
|
||||
url: '/rpc/v2/products/ftai',
|
||||
params: ['uid' => $uid, 'type' => $pointType->value],
|
||||
);
|
||||
|
||||
$content = $response->getBody()->getContents();
|
||||
$result = Json::decode($content);
|
||||
|
||||
return new RechargeProduct(
|
||||
oneTime: isset($result['one_time'])
|
||||
? new ProductItem(
|
||||
id: $result['one_time']['id'],
|
||||
description: $result['one_time']['name'],
|
||||
unitPrice: new Money(
|
||||
amount: bcmul((string)$result['one_time']['price'], '100'),
|
||||
currency: new Currency($result['one_time']['currency']),
|
||||
),
|
||||
productType: ProductType::oneTime,
|
||||
effect: new RechargeEffect(
|
||||
pointType: $pointType,
|
||||
pointBasic: $result['one_time']['point']['number'],
|
||||
pointBonus: $result['one_time']['point']['bonus'],
|
||||
),
|
||||
)
|
||||
: null,
|
||||
plans: array_map(fn(array $item) => new ProductItem(
|
||||
id: $item['id'],
|
||||
description: $item['name'],
|
||||
unitPrice: new Money(
|
||||
amount: bcmul((string)$item['price'], '100'),
|
||||
currency: new Currency($item['currency']),
|
||||
),
|
||||
productType: ProductType::plan,
|
||||
), $result['plan']),
|
||||
packages: array_map(fn(array $item) => new ProductItem(
|
||||
id: $item['id'],
|
||||
description: $item['name'],
|
||||
unitPrice: new Money(
|
||||
amount: bcmul((string)$item['price'], '100'),
|
||||
currency: new Currency($item['currency']),
|
||||
),
|
||||
productType: ProductType::plan,
|
||||
effect: new RechargeEffect(
|
||||
pointType: $pointType,
|
||||
pointBasic: $item['point']['number'],
|
||||
pointBonus: $item['point']['bonus'],
|
||||
),
|
||||
), $result['package']),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -91,7 +144,7 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter
|
||||
id: $result['one_time']['id'],
|
||||
description: $result['one_time']['name'],
|
||||
unitPrice: new Money(
|
||||
amount: $result['one_time']['price'],
|
||||
amount:bcmul((string)$result['one_time']['price'], '100'),
|
||||
currency: new Currency($result['one_time']['currency']),
|
||||
),
|
||||
productType: ProductType::oneTime,
|
||||
@@ -107,7 +160,7 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter
|
||||
id: $result['renew']['id'],
|
||||
description: $result['renew']['name'],
|
||||
unitPrice: new Money(
|
||||
amount: $result['renew']['price'],
|
||||
amount: bcmul((string)$result['renew']['price'], '100'),
|
||||
currency: new Currency($result['renew']['currency']),
|
||||
),
|
||||
productType: ProductType::renew,
|
||||
@@ -122,12 +175,12 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter
|
||||
id: $item['id'],
|
||||
description: $item['name'],
|
||||
unitPrice: new Money(
|
||||
amount: $item['price'],
|
||||
amount: bcmul((string)$item['price'], '100'),
|
||||
currency: new Currency($item['currency']),
|
||||
),
|
||||
productType: ProductType::plan,
|
||||
effect: new RechargeEffect(
|
||||
pointType: PointType::LuxPoint,
|
||||
pointType: PointType::EMA,
|
||||
pointBasic: $item['point']['number'],
|
||||
pointBonus: $item['point']['bonus'],
|
||||
),
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace Singularity\HDK\Pay\Resource\V2;
|
||||
|
||||
use App\Model\ServiceProvider;
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Resource\Json\JsonResource;
|
||||
use Money\Currency;
|
||||
use Money\Money;
|
||||
use Singularity\HDK\Pay\Enum\OrderStatus;
|
||||
use stdClass;
|
||||
|
||||
@@ -48,6 +48,9 @@ class Order extends JsonResource
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
if (empty($this->resource['order_no'])) {
|
||||
return $this->parseClassicOrder();
|
||||
}
|
||||
return [
|
||||
'order_no' => $this->order_no,
|
||||
'state' => $this->state,
|
||||
@@ -65,6 +68,25 @@ class Order extends JsonResource
|
||||
];
|
||||
}
|
||||
|
||||
private function parseClassicOrder(): array
|
||||
{
|
||||
return [
|
||||
'order_no' => $this->orderNo,
|
||||
'state' => $this->state,
|
||||
'transaction_id' => $this->transactionId,
|
||||
'uid' => $this->uid,
|
||||
'method' => $this->payment,
|
||||
'description' => $this->goodsName,
|
||||
'total_amount' => new Money($this->amount['amount'], new Currency($this->amount['currency'])),
|
||||
'currency' => $this->amount['currency'],
|
||||
'items' => [],
|
||||
'external' => [],
|
||||
'remark' => $this->remark,
|
||||
'notification' => $this->notification ?? [],
|
||||
'more_details' => [],
|
||||
];
|
||||
}
|
||||
|
||||
public function __get($key)
|
||||
{
|
||||
return $this->resource->{$key} ?? $this->resource[$key];
|
||||
|
||||
@@ -76,8 +76,8 @@ final class WechatRpc
|
||||
'amount' => (int)$money->getAmount(),
|
||||
'fileType' => $type,
|
||||
'uid' => $uid,
|
||||
'goods_detail' => [
|
||||
'goods_name' => $goodsName,
|
||||
'goodsDetail' => [
|
||||
'goodsName' => $goodsName,
|
||||
],
|
||||
'number' => $number,
|
||||
],
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Created on 2025/8/18
|
||||
*/
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\AccountBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\Account\AccountBalance;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\AccountBalanceRepo;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Created on 2025/8/18
|
||||
*/
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\ValueObject\PointsBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\Account\PointsBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\AccountBalanceRepo;
|
||||
|
||||
|
||||
25
tests/Feature/Account/QueryPointLogListTest.php
Normal file
25
tests/Feature/Account/QueryPointLogListTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* QueryPointLogListTest.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/27
|
||||
*/
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\PointLog\PointLog;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\PointLogRepo;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
it('should can query point log list', function () {
|
||||
$uid = '61a74db54f387';
|
||||
|
||||
$repo = make(PointLogRepo::class);
|
||||
$list = $repo->getList($uid);
|
||||
expect($list)
|
||||
->not->toBeEmpty()
|
||||
->each
|
||||
->toBeInstanceOf(PointLog::class);
|
||||
});
|
||||
37
tests/Feature/Invoice/CreateInvoiceTest.php
Normal file
37
tests/Feature/Invoice/CreateInvoiceTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* CreateInvoiceTest.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/29
|
||||
*/
|
||||
|
||||
use Singularity\HDK\Pay\Application\Command\CreateInvoiceCmd;
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\Invoice;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\InvoiceRepo;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
it('should can create invoice', function () {
|
||||
$repo = make(InvoiceRepo::class);
|
||||
|
||||
$invoice = $repo->create(
|
||||
new CreateInvoiceCmd(
|
||||
uid: '61dbe752d4caa',
|
||||
caseId: '68affb136c01d',
|
||||
setFreqInvAddr: true,
|
||||
receiver: "dongyun.li@luxcreo.ai",
|
||||
patientName: "Ms. Jennifer Durgan",
|
||||
address: "12345 Magnolia Boulevard Northeast,Apartment 5678, Suite 910",
|
||||
city: "Springfield",
|
||||
state: "Illinois",
|
||||
country: "United States",
|
||||
zipCode: "67890-1234",
|
||||
),
|
||||
);
|
||||
|
||||
expect($invoice)
|
||||
->toBeInstanceOf(Invoice::class);
|
||||
});
|
||||
25
tests/Feature/Invoice/QueryCaseInvoiceProductTest.php
Normal file
25
tests/Feature/Invoice/QueryCaseInvoiceProductTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* QueryCaseInvoiceProductTest.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/28
|
||||
*/
|
||||
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Invoice\InvoiceProduct;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\InvoiceProductRepo;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
it('should can query case invoice product', function () {
|
||||
$invoiceProductRepo = make(InvoiceProductRepo::class);
|
||||
|
||||
$caseId = '68affb136c01d';
|
||||
|
||||
$result = $invoiceProductRepo->getCaseProduct(caseId: $caseId);
|
||||
|
||||
expect($result)->toBeInstanceOf(InvoiceProduct::class);
|
||||
});
|
||||
23
tests/Feature/Invoice/QueryFreqAddrTest.php
Normal file
23
tests/Feature/Invoice/QueryFreqAddrTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* QueryFreqAddrTest.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/29
|
||||
*/
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Invoice\Aggregate\Address\FrequentAddress;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\FrequentAddressRepo;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
it('should can query frequent invoice address', function () {
|
||||
$uid = '61dbe752d4caa';
|
||||
|
||||
$addrRepo = make(FrequentAddressRepo::class);
|
||||
$freq_addr = $addrRepo->findByUser($uid);
|
||||
|
||||
expect($freq_addr)->toBeInstanceOf(FrequentAddress::class);
|
||||
});
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
use Pest\Expectation;
|
||||
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
||||
use Singularity\HDK\Pay\Domain\Product\Aggregate\Entities\ProductItem;
|
||||
use Singularity\HDK\Pay\Domain\Product\Aggregate\RechargeProduct;
|
||||
use Singularity\HDK\Pay\Infrastructure\Repository\ProductRepo;
|
||||
@@ -44,3 +45,19 @@ it('should can query EMA products', function () {
|
||||
)
|
||||
->and($products->getPlans())->each->toBeInstanceOf(ProductItem::class);
|
||||
});
|
||||
|
||||
it('should can query FTAI products', function () {
|
||||
$repo = make(ProductRepo::class);
|
||||
|
||||
$uid = '61efabc21e5a2';
|
||||
$products = $repo->findFtaiProduct($uid, PointType::FtaiAligner);
|
||||
expect($products)
|
||||
->toBeInstanceOf(RechargeProduct::class)
|
||||
->when(
|
||||
$products->getOneTime() !== null,
|
||||
fn(Expectation $expectation) => $expectation
|
||||
->and($products->getOneTime())->toBeInstanceOf(ProductItem::class),
|
||||
)
|
||||
->and($products->getPackages())->each->toBeInstanceOf(ProductItem::class)
|
||||
->and($products->getPlans())->each->toBeInstanceOf(ProductItem::class);
|
||||
});
|
||||
|
||||
@@ -32,4 +32,4 @@ test(
|
||||
);
|
||||
expect($goods)->toBeInstanceOf(Goods::class);
|
||||
}
|
||||
);
|
||||
)->skip();
|
||||
|
||||
Reference in New Issue
Block a user