From 681458023e22cf74d4c153dbf9b3284cbabad408 Mon Sep 17 00:00:00 2001 From: yansongda Date: Sun, 19 Mar 2023 22:18:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?change:=20=E6=89=80=E6=9C=89=E7=9A=84=20`Fi?= =?UTF-8?q?nd*Plugin`=20=E8=B0=83=E6=95=B4=E4=B8=BA=20`Query*Plugin`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 ++- .../Ecommerce/Refund/{FindPlugin.php => QueryPlugin.php} | 2 +- ...turnAdvancePlugin.php => QueryReturnAdvancePlugin.php} | 2 +- .../App/{FindRefundPlugin.php => QueryRefundPlugin.php} | 2 +- .../{FindRefundPlugin.php => QueryRefundPlugin.php} | 2 +- .../{FindRefundPlugin.php => QueryRefundPlugin.php} | 2 +- .../H5/{FindRefundPlugin.php => QueryRefundPlugin.php} | 2 +- .../Jsapi/{FindRefundPlugin.php => QueryRefundPlugin.php} | 2 +- .../Mini/{FindRefundPlugin.php => QueryRefundPlugin.php} | 2 +- .../{FindRefundPlugin.php => QueryRefundPlugin.php} | 2 +- src/Plugin/Wechat/Shortcut/QueryShortcut.php | 4 ++-- .../Refund/{FindPluginTest.php => QueryPluginTest.php} | 8 ++++---- ...ncePluginTest.php => QueryReturnAdvancePluginTest.php} | 8 ++++---- ...FindRefundPluginTest.php => QueryRefundPluginTest.php} | 8 ++++---- tests/Plugin/Wechat/Shortcut/QueryShortcutTest.php | 4 ++-- 15 files changed, 27 insertions(+), 26 deletions(-) rename src/Plugin/Wechat/Ecommerce/Refund/{FindPlugin.php => QueryPlugin.php} (97%) rename src/Plugin/Wechat/Ecommerce/Refund/{FindReturnAdvancePlugin.php => QueryReturnAdvancePlugin.php} (96%) rename src/Plugin/Wechat/Pay/App/{FindRefundPlugin.php => QueryRefundPlugin.php} (64%) rename src/Plugin/Wechat/Pay/Combine/{FindRefundPlugin.php => QueryRefundPlugin.php} (65%) rename src/Plugin/Wechat/Pay/Common/{FindRefundPlugin.php => QueryRefundPlugin.php} (96%) rename src/Plugin/Wechat/Pay/H5/{FindRefundPlugin.php => QueryRefundPlugin.php} (64%) rename src/Plugin/Wechat/Pay/Jsapi/{FindRefundPlugin.php => QueryRefundPlugin.php} (65%) rename src/Plugin/Wechat/Pay/Mini/{FindRefundPlugin.php => QueryRefundPlugin.php} (65%) rename src/Plugin/Wechat/Pay/Native/{FindRefundPlugin.php => QueryRefundPlugin.php} (65%) rename tests/Plugin/Wechat/Ecommerce/Refund/{FindPluginTest.php => QueryPluginTest.php} (91%) rename tests/Plugin/Wechat/Ecommerce/Refund/{FindReturnAdvancePluginTest.php => QueryReturnAdvancePluginTest.php} (86%) rename tests/Plugin/Wechat/Pay/Common/{FindRefundPluginTest.php => QueryRefundPluginTest.php} (90%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 885d85335..0d25e8f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,9 @@ ### changed +- change: 所有的 `Find*Plugin` 调整为 `Query*Plugin`(#756) - change: 插件开始装载日志由 `info` 调整为 `debug`(#755) -- change: ParserInterface 签名由 `?ResponseInterface $response` 变更为 `PackerInterface $packer, ?ResponseInterface $response`(#754) +- change: ParserInterface 签名由 `?ResponseInterface $response` 调整为 `PackerInterface $packer, ?ResponseInterface $response`(#754) ## v3.2.14 diff --git a/src/Plugin/Wechat/Ecommerce/Refund/FindPlugin.php b/src/Plugin/Wechat/Ecommerce/Refund/QueryPlugin.php similarity index 97% rename from src/Plugin/Wechat/Ecommerce/Refund/FindPlugin.php rename to src/Plugin/Wechat/Ecommerce/Refund/QueryPlugin.php index 5b28c0116..0d902c3af 100644 --- a/src/Plugin/Wechat/Ecommerce/Refund/FindPlugin.php +++ b/src/Plugin/Wechat/Ecommerce/Refund/QueryPlugin.php @@ -15,7 +15,7 @@ /** * @see https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_2.shtml */ -class FindPlugin extends GeneralPlugin +class QueryPlugin extends GeneralPlugin { /** * @throws \Yansongda\Pay\Exception\InvalidParamsException diff --git a/src/Plugin/Wechat/Ecommerce/Refund/FindReturnAdvancePlugin.php b/src/Plugin/Wechat/Ecommerce/Refund/QueryReturnAdvancePlugin.php similarity index 96% rename from src/Plugin/Wechat/Ecommerce/Refund/FindReturnAdvancePlugin.php rename to src/Plugin/Wechat/Ecommerce/Refund/QueryReturnAdvancePlugin.php index 5e4cc4356..e27897e97 100644 --- a/src/Plugin/Wechat/Ecommerce/Refund/FindReturnAdvancePlugin.php +++ b/src/Plugin/Wechat/Ecommerce/Refund/QueryReturnAdvancePlugin.php @@ -15,7 +15,7 @@ /** * @see https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_5.shtml */ -class FindReturnAdvancePlugin extends GeneralPlugin +class QueryReturnAdvancePlugin extends GeneralPlugin { /** * @throws \Yansongda\Pay\Exception\InvalidParamsException diff --git a/src/Plugin/Wechat/Pay/App/FindRefundPlugin.php b/src/Plugin/Wechat/Pay/App/QueryRefundPlugin.php similarity index 64% rename from src/Plugin/Wechat/Pay/App/FindRefundPlugin.php rename to src/Plugin/Wechat/Pay/App/QueryRefundPlugin.php index 7d0d612f2..281851ec5 100644 --- a/src/Plugin/Wechat/Pay/App/FindRefundPlugin.php +++ b/src/Plugin/Wechat/Pay/App/QueryRefundPlugin.php @@ -7,6 +7,6 @@ /** * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_2_10.shtml */ -class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin +class QueryRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin { } diff --git a/src/Plugin/Wechat/Pay/Combine/FindRefundPlugin.php b/src/Plugin/Wechat/Pay/Combine/QueryRefundPlugin.php similarity index 65% rename from src/Plugin/Wechat/Pay/Combine/FindRefundPlugin.php rename to src/Plugin/Wechat/Pay/Combine/QueryRefundPlugin.php index ac82da5de..16ba93af9 100644 --- a/src/Plugin/Wechat/Pay/Combine/FindRefundPlugin.php +++ b/src/Plugin/Wechat/Pay/Combine/QueryRefundPlugin.php @@ -7,6 +7,6 @@ /** * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter5_1_15.shtml */ -class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin +class QueryRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin { } diff --git a/src/Plugin/Wechat/Pay/Common/FindRefundPlugin.php b/src/Plugin/Wechat/Pay/Common/QueryRefundPlugin.php similarity index 96% rename from src/Plugin/Wechat/Pay/Common/FindRefundPlugin.php rename to src/Plugin/Wechat/Pay/Common/QueryRefundPlugin.php index 0922803fb..328620cce 100644 --- a/src/Plugin/Wechat/Pay/Common/FindRefundPlugin.php +++ b/src/Plugin/Wechat/Pay/Common/QueryRefundPlugin.php @@ -12,7 +12,7 @@ use Yansongda\Pay\Plugin\Wechat\GeneralPlugin; use Yansongda\Pay\Rocket; -class FindRefundPlugin extends GeneralPlugin +class QueryRefundPlugin extends GeneralPlugin { /** * @throws \Yansongda\Pay\Exception\InvalidParamsException diff --git a/src/Plugin/Wechat/Pay/H5/FindRefundPlugin.php b/src/Plugin/Wechat/Pay/H5/QueryRefundPlugin.php similarity index 64% rename from src/Plugin/Wechat/Pay/H5/FindRefundPlugin.php rename to src/Plugin/Wechat/Pay/H5/QueryRefundPlugin.php index 46b908e97..a94e09d12 100644 --- a/src/Plugin/Wechat/Pay/H5/FindRefundPlugin.php +++ b/src/Plugin/Wechat/Pay/H5/QueryRefundPlugin.php @@ -7,6 +7,6 @@ /** * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_10.shtml */ -class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin +class QueryRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin { } diff --git a/src/Plugin/Wechat/Pay/Jsapi/FindRefundPlugin.php b/src/Plugin/Wechat/Pay/Jsapi/QueryRefundPlugin.php similarity index 65% rename from src/Plugin/Wechat/Pay/Jsapi/FindRefundPlugin.php rename to src/Plugin/Wechat/Pay/Jsapi/QueryRefundPlugin.php index 8b94155b1..fc10ac33c 100644 --- a/src/Plugin/Wechat/Pay/Jsapi/FindRefundPlugin.php +++ b/src/Plugin/Wechat/Pay/Jsapi/QueryRefundPlugin.php @@ -7,6 +7,6 @@ /** * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_10.shtml */ -class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin +class QueryRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin { } diff --git a/src/Plugin/Wechat/Pay/Mini/FindRefundPlugin.php b/src/Plugin/Wechat/Pay/Mini/QueryRefundPlugin.php similarity index 65% rename from src/Plugin/Wechat/Pay/Mini/FindRefundPlugin.php rename to src/Plugin/Wechat/Pay/Mini/QueryRefundPlugin.php index 57c4b68da..769ceef6e 100644 --- a/src/Plugin/Wechat/Pay/Mini/FindRefundPlugin.php +++ b/src/Plugin/Wechat/Pay/Mini/QueryRefundPlugin.php @@ -7,6 +7,6 @@ /** * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_5_10.shtml */ -class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin +class QueryRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin { } diff --git a/src/Plugin/Wechat/Pay/Native/FindRefundPlugin.php b/src/Plugin/Wechat/Pay/Native/QueryRefundPlugin.php similarity index 65% rename from src/Plugin/Wechat/Pay/Native/FindRefundPlugin.php rename to src/Plugin/Wechat/Pay/Native/QueryRefundPlugin.php index f9af059f4..3b6a0bf32 100644 --- a/src/Plugin/Wechat/Pay/Native/FindRefundPlugin.php +++ b/src/Plugin/Wechat/Pay/Native/QueryRefundPlugin.php @@ -7,6 +7,6 @@ /** * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_4_10.shtml */ -class FindRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin +class QueryRefundPlugin extends \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin { } diff --git a/src/Plugin/Wechat/Shortcut/QueryShortcut.php b/src/Plugin/Wechat/Shortcut/QueryShortcut.php index 32dbce05a..757d504da 100644 --- a/src/Plugin/Wechat/Shortcut/QueryShortcut.php +++ b/src/Plugin/Wechat/Shortcut/QueryShortcut.php @@ -7,7 +7,7 @@ use Yansongda\Pay\Contract\ShortcutInterface; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Exception\InvalidParamsException; -use Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin; +use Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin; use Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryPlugin; use Yansongda\Supports\Str; @@ -41,7 +41,7 @@ protected function defaultPlugins(): array protected function refundPlugins(): array { return [ - FindRefundPlugin::class, + QueryRefundPlugin::class, ]; } diff --git a/tests/Plugin/Wechat/Ecommerce/Refund/FindPluginTest.php b/tests/Plugin/Wechat/Ecommerce/Refund/QueryPluginTest.php similarity index 91% rename from tests/Plugin/Wechat/Ecommerce/Refund/FindPluginTest.php rename to tests/Plugin/Wechat/Ecommerce/Refund/QueryPluginTest.php index 4dfd118fc..a166a856b 100644 --- a/tests/Plugin/Wechat/Ecommerce/Refund/FindPluginTest.php +++ b/tests/Plugin/Wechat/Ecommerce/Refund/QueryPluginTest.php @@ -6,16 +6,16 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Exception\InvalidParamsException; use Yansongda\Pay\Pay; -use Yansongda\Pay\Plugin\Wechat\Ecommerce\Refund\FindPlugin; +use Yansongda\Pay\Plugin\Wechat\Ecommerce\Refund\QueryPlugin; use Yansongda\Pay\Provider\Wechat; use Yansongda\Pay\Rocket; use Yansongda\Pay\Tests\TestCase; use Yansongda\Supports\Collection; -class FindPluginTest extends TestCase +class QueryPluginTest extends TestCase { /** - * @var \Yansongda\Pay\Plugin\Wechat\Ecommerce\Refund\FindPlugin + * @var \Yansongda\Pay\Plugin\Wechat\Ecommerce\Refund\QueryPlugin */ protected $plugin; @@ -23,7 +23,7 @@ protected function setUp(): void { parent::setUp(); - $this->plugin = new FindPlugin(); + $this->plugin = new QueryPlugin(); } public function testNotInServiceMode() diff --git a/tests/Plugin/Wechat/Ecommerce/Refund/FindReturnAdvancePluginTest.php b/tests/Plugin/Wechat/Ecommerce/Refund/QueryReturnAdvancePluginTest.php similarity index 86% rename from tests/Plugin/Wechat/Ecommerce/Refund/FindReturnAdvancePluginTest.php rename to tests/Plugin/Wechat/Ecommerce/Refund/QueryReturnAdvancePluginTest.php index 9daafc75d..4735a578f 100644 --- a/tests/Plugin/Wechat/Ecommerce/Refund/FindReturnAdvancePluginTest.php +++ b/tests/Plugin/Wechat/Ecommerce/Refund/QueryReturnAdvancePluginTest.php @@ -6,16 +6,16 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Exception\InvalidParamsException; use Yansongda\Pay\Pay; -use Yansongda\Pay\Plugin\Wechat\Ecommerce\Refund\FindReturnAdvancePlugin; +use Yansongda\Pay\Plugin\Wechat\Ecommerce\Refund\QueryReturnAdvancePlugin; use Yansongda\Pay\Provider\Wechat; use Yansongda\Pay\Rocket; use Yansongda\Pay\Tests\TestCase; use Yansongda\Supports\Collection; -class FindReturnAdvancePluginTest extends TestCase +class QueryReturnAdvancePluginTest extends TestCase { /** - * @var \Yansongda\Pay\Plugin\Wechat\Ecommerce\Refund\FindReturnAdvancePlugin + * @var \Yansongda\Pay\Plugin\Wechat\Ecommerce\Refund\QueryReturnAdvancePlugin */ protected $plugin; @@ -23,7 +23,7 @@ protected function setUp(): void { parent::setUp(); - $this->plugin = new FindReturnAdvancePlugin(); + $this->plugin = new QueryReturnAdvancePlugin(); } public function testNotInServiceMode() diff --git a/tests/Plugin/Wechat/Pay/Common/FindRefundPluginTest.php b/tests/Plugin/Wechat/Pay/Common/QueryRefundPluginTest.php similarity index 90% rename from tests/Plugin/Wechat/Pay/Common/FindRefundPluginTest.php rename to tests/Plugin/Wechat/Pay/Common/QueryRefundPluginTest.php index d6303d48e..2c8360fd1 100644 --- a/tests/Plugin/Wechat/Pay/Common/FindRefundPluginTest.php +++ b/tests/Plugin/Wechat/Pay/Common/QueryRefundPluginTest.php @@ -5,16 +5,16 @@ use GuzzleHttp\Psr7\Uri; use Psr\Http\Message\RequestInterface; use Yansongda\Pay\Pay; -use Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin; +use Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin; use Yansongda\Pay\Provider\Wechat; use Yansongda\Pay\Rocket; use Yansongda\Pay\Tests\TestCase; use Yansongda\Supports\Collection; -class FindRefundPluginTest extends TestCase +class QueryRefundPluginTest extends TestCase { /** - * @var \Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin + * @var \Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin */ protected $plugin; @@ -22,7 +22,7 @@ protected function setUp(): void { parent::setUp(); - $this->plugin = new FindRefundPlugin(); + $this->plugin = new QueryRefundPlugin(); } public function testNormal() diff --git a/tests/Plugin/Wechat/Shortcut/QueryShortcutTest.php b/tests/Plugin/Wechat/Shortcut/QueryShortcutTest.php index 11ebd0da3..882ad01a3 100644 --- a/tests/Plugin/Wechat/Shortcut/QueryShortcutTest.php +++ b/tests/Plugin/Wechat/Shortcut/QueryShortcutTest.php @@ -6,7 +6,7 @@ use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Exception\InvalidParamsException; -use Yansongda\Pay\Plugin\Wechat\Pay\Common\FindRefundPlugin; +use Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin; use Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryPlugin; use Yansongda\Pay\Plugin\Wechat\Shortcut\QueryShortcut; use Yansongda\Pay\Tests\TestCase; @@ -32,7 +32,7 @@ public function testDefault() public function testRefund() { self::assertEquals([ - FindRefundPlugin::class, + QueryRefundPlugin::class, ], $this->plugin->getPlugins(['_type' => 'refund'])); } From 713ba30dfe1934d94b33e20074914bedfc77ffe0 Mon Sep 17 00:00:00 2001 From: yansongda Date: Sun, 19 Mar 2023 22:20:28 +0800 Subject: [PATCH 2/2] update --- src/Plugin/Wechat/Shortcut/QueryShortcut.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugin/Wechat/Shortcut/QueryShortcut.php b/src/Plugin/Wechat/Shortcut/QueryShortcut.php index 757d504da..ad200d58f 100644 --- a/src/Plugin/Wechat/Shortcut/QueryShortcut.php +++ b/src/Plugin/Wechat/Shortcut/QueryShortcut.php @@ -7,8 +7,8 @@ use Yansongda\Pay\Contract\ShortcutInterface; use Yansongda\Pay\Exception\Exception; use Yansongda\Pay\Exception\InvalidParamsException; -use Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin; use Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryPlugin; +use Yansongda\Pay\Plugin\Wechat\Pay\Common\QueryRefundPlugin; use Yansongda\Supports\Str; class QueryShortcut implements ShortcutInterface