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`