From 6db99832ae2d52c4aa563ca6f2759ec1cf3dcde0 Mon Sep 17 00:00:00 2001 From: yansongda Date: Tue, 28 Nov 2023 20:52:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=AE=9D=20=E5=88=86=E8=B4=A6=E5=85=B3=E7=B3=BB=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4/=E5=88=86=E8=B4=A6=E6=9F=A5=E8=AF=A2=20=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20(#874)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 +++- .../Alipay/Trade/OrderSettleQueryPlugin.php | 18 +++++++++++ .../Trade/RoyaltyRelationBatchQueryPlugin.php | 18 +++++++++++ .../Trade/RoyaltyRelationBindPlugin.php | 18 +++++++++++ .../Trade/RoyaltyRelationUnbindPlugin.php | 18 +++++++++++ .../Plugin/Alipay/Trade/AppPayPluginTest.php | 2 +- .../Trade/OrderSettleQueryPluginTest.php | 31 +++++++++++++++++++ .../Plugin/Alipay/Trade/PagePayPluginTest.php | 2 +- .../Alipay/Trade/PageRefundPluginTest.php | 2 +- tests/Plugin/Alipay/Trade/PayPluginTest.php | 2 +- .../RoyaltyRelationBatchQueryPluginTest.php | 29 +++++++++++++++++ .../Trade/RoyaltyRelationBindPluginTest.php | 29 +++++++++++++++++ .../Trade/RoyaltyRelationUnbindPluginTest.php | 30 ++++++++++++++++++ tests/Plugin/Alipay/Trade/WapPluginTest.php | 2 +- web/docs/v3/alipay/more.md | 18 +++++++++++ 15 files changed, 219 insertions(+), 6 deletions(-) create mode 100644 src/Plugin/Alipay/Trade/OrderSettleQueryPlugin.php create mode 100644 src/Plugin/Alipay/Trade/RoyaltyRelationBatchQueryPlugin.php create mode 100644 src/Plugin/Alipay/Trade/RoyaltyRelationBindPlugin.php create mode 100644 src/Plugin/Alipay/Trade/RoyaltyRelationUnbindPlugin.php create mode 100644 tests/Plugin/Alipay/Trade/OrderSettleQueryPluginTest.php create mode 100644 tests/Plugin/Alipay/Trade/RoyaltyRelationBatchQueryPluginTest.php create mode 100644 tests/Plugin/Alipay/Trade/RoyaltyRelationBindPluginTest.php create mode 100644 tests/Plugin/Alipay/Trade/RoyaltyRelationUnbindPluginTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 254dc6062..b911ebf0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## v3.5.3-TBD +## v3.5.3 + +### feat + +- feat: 增加支付宝 分账关系维护/分账查询 插件(#874) ### optimized diff --git a/src/Plugin/Alipay/Trade/OrderSettleQueryPlugin.php b/src/Plugin/Alipay/Trade/OrderSettleQueryPlugin.php new file mode 100644 index 000000000..f8f0ef69a --- /dev/null +++ b/src/Plugin/Alipay/Trade/OrderSettleQueryPlugin.php @@ -0,0 +1,18 @@ +plugin = new OrderSettleQueryPlugin(); + } + + public function testNormal() + { + $rocket = new Rocket(); + $rocket->setParams([]); + + $result = $this->plugin->assembly($rocket, function ($rocket) { return $rocket; }); + + self::assertStringContainsString('alipay.trade.order.settle.query', $result->getPayload()->toJson()); + } +} diff --git a/tests/Plugin/Alipay/Trade/PagePayPluginTest.php b/tests/Plugin/Alipay/Trade/PagePayPluginTest.php index 0f387c769..6e321aa5a 100644 --- a/tests/Plugin/Alipay/Trade/PagePayPluginTest.php +++ b/tests/Plugin/Alipay/Trade/PagePayPluginTest.php @@ -9,7 +9,7 @@ class PagePayPluginTest extends TestCase { - protected $plugin; + protected PagePayPlugin $plugin; protected function setUp(): void { diff --git a/tests/Plugin/Alipay/Trade/PageRefundPluginTest.php b/tests/Plugin/Alipay/Trade/PageRefundPluginTest.php index 53cdbd942..882257352 100644 --- a/tests/Plugin/Alipay/Trade/PageRefundPluginTest.php +++ b/tests/Plugin/Alipay/Trade/PageRefundPluginTest.php @@ -9,7 +9,7 @@ class PageRefundPluginTest extends TestCase { - protected $plugin; + protected PageRefundPlugin $plugin; protected function setUp(): void { diff --git a/tests/Plugin/Alipay/Trade/PayPluginTest.php b/tests/Plugin/Alipay/Trade/PayPluginTest.php index 6cd96d9fc..2a0f56a7e 100644 --- a/tests/Plugin/Alipay/Trade/PayPluginTest.php +++ b/tests/Plugin/Alipay/Trade/PayPluginTest.php @@ -9,7 +9,7 @@ class PayPluginTest extends TestCase { - protected $plugin; + protected PayPlugin $plugin; protected function setUp(): void { diff --git a/tests/Plugin/Alipay/Trade/RoyaltyRelationBatchQueryPluginTest.php b/tests/Plugin/Alipay/Trade/RoyaltyRelationBatchQueryPluginTest.php new file mode 100644 index 000000000..548c4038c --- /dev/null +++ b/tests/Plugin/Alipay/Trade/RoyaltyRelationBatchQueryPluginTest.php @@ -0,0 +1,29 @@ +plugin = new RoyaltyRelationBatchQueryPlugin(); + } + + public function testNormal() + { + $rocket = new Rocket(); + $rocket->setParams([]); + + $result = $this->plugin->assembly($rocket, function ($rocket) { return $rocket; }); + + self::assertStringContainsString('alipay.trade.royalty.relation.batchquery', $result->getPayload()->toJson()); + } +} diff --git a/tests/Plugin/Alipay/Trade/RoyaltyRelationBindPluginTest.php b/tests/Plugin/Alipay/Trade/RoyaltyRelationBindPluginTest.php new file mode 100644 index 000000000..4f552c8e6 --- /dev/null +++ b/tests/Plugin/Alipay/Trade/RoyaltyRelationBindPluginTest.php @@ -0,0 +1,29 @@ +plugin = new RoyaltyRelationBindPlugin(); + } + + public function testNormal() + { + $rocket = new Rocket(); + $rocket->setParams([]); + + $result = $this->plugin->assembly($rocket, function ($rocket) { return $rocket; }); + + self::assertStringContainsString('alipay.trade.royalty.relation.bind', $result->getPayload()->toJson()); + } +} diff --git a/tests/Plugin/Alipay/Trade/RoyaltyRelationUnbindPluginTest.php b/tests/Plugin/Alipay/Trade/RoyaltyRelationUnbindPluginTest.php new file mode 100644 index 000000000..2017c00a7 --- /dev/null +++ b/tests/Plugin/Alipay/Trade/RoyaltyRelationUnbindPluginTest.php @@ -0,0 +1,30 @@ +plugin = new RoyaltyRelationUnbindPlugin(); + } + + public function testNormal() + { + $rocket = new Rocket(); + $rocket->setParams([]); + + $result = $this->plugin->assembly($rocket, function ($rocket) { return $rocket; }); + + self::assertStringContainsString('alipay.trade.royalty.relation.unbind', $result->getPayload()->toJson()); + } +} diff --git a/tests/Plugin/Alipay/Trade/WapPluginTest.php b/tests/Plugin/Alipay/Trade/WapPluginTest.php index 88dc35bc6..dd78de0c8 100644 --- a/tests/Plugin/Alipay/Trade/WapPluginTest.php +++ b/tests/Plugin/Alipay/Trade/WapPluginTest.php @@ -9,7 +9,7 @@ class WapPluginTest extends TestCase { - protected $plugin; + protected WapPayPlugin $plugin; protected function setUp(): void { diff --git a/web/docs/v3/alipay/more.md b/web/docs/v3/alipay/more.md index 2fe407c5c..83d5d3ff0 100644 --- a/web/docs/v3/alipay/more.md +++ b/web/docs/v3/alipay/more.md @@ -135,3 +135,21 @@ $result = Pay::alipay()->pay($allPlugins, $params); ### 协议由普通通用代扣协议产品转移到周期扣协议产品 - `Yansongda\Pay\Plugin\Alipay\User\AgreementTransferPlugin` + +## 交易 + +### 交易分账查询接口 + +- `Yansongda\Pay\Plugin\Alipay\Trade\OrderSettleQueryPlugin` + +### 分账关系查询 + +- `Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationBatchQueryPlugin` + +### 分账关系绑定 + +- `Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationBindPlugin` + +### 分账关系解绑 + +- `Yansongda\Pay\Plugin\Alipay\Trade\RoyaltyRelationUnbindPlugin`