From 013b5769ed79223155cbb58d0dd9bcf9744023f4 Mon Sep 17 00:00:00 2001 From: yansongda Date: Sun, 21 Jan 2024 17:09:41 +0800 Subject: [PATCH] =?UTF-8?q?change:=20=E6=94=AF=E4=BB=98=E5=AE=9D=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E7=BD=91=E7=AB=99=E6=94=AF=E4=BB=98=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E7=94=B1=20wap=20=E6=94=B9=E4=B8=BA=20h5=20(?= =?UTF-8?q?#934)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- src/Shortcut/Alipay/CloseShortcut.php | 6 ++--- src/Shortcut/Alipay/QueryShortcut.php | 23 ++++++-------------- src/Shortcut/Alipay/RefundShortcut.php | 6 ++--- tests/Shortcut/Alipay/CloseShortcutTest.php | 4 ++-- tests/Shortcut/Alipay/QueryShortcutTest.php | 8 +++---- tests/Shortcut/Alipay/RefundShortcutTest.php | 4 ++-- 7 files changed, 22 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc29403..cb7efb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ - change: 查询API方法由 `find` 改为 `query`,同时参数只支持 array(#897) - change: cancel/close 的 API 参数只支持 array,不再支持 string(#900, #901) - change: 微信合单支付去掉独立的 `combine_app_id`,`combine_mch_id` 配置,复用其它配置(#909) -- change: 手机网站支付快捷方式由 wap 改为 h5(#911, #915, #916) +- change: 手机网站支付快捷方式由 wap 改为 h5(#911, #915, #916, #934) - change: `Pay` 类对外方法由所改变,如果您有自行扩展相关插件,请检查(#926) - change(internal): 按场景对 支付宝/微信/银联 插件进行分类 && 插件代码优化(#894, #909, #913, #922) - change(internal): 将 支付/微信/银联 shortcut 从 plugin 文件夹独立出来(#895, #904, #905, #933) diff --git a/src/Shortcut/Alipay/CloseShortcut.php b/src/Shortcut/Alipay/CloseShortcut.php index b4af50a..d29a4e6 100644 --- a/src/Shortcut/Alipay/CloseShortcut.php +++ b/src/Shortcut/Alipay/CloseShortcut.php @@ -14,7 +14,7 @@ use Yansongda\Pay\Plugin\Alipay\V2\FormatPayloadBizContentPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\ClosePlugin as AgreementClosePlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\App\ClosePlugin as AppClosePlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\ClosePlugin as AuthorizationClosePlugin; -use Yansongda\Pay\Plugin\Alipay\V2\Pay\H5\ClosePlugin as WapClosePlugin; +use Yansongda\Pay\Plugin\Alipay\V2\Pay\H5\ClosePlugin as H5ClosePlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini\ClosePlugin as MiniClosePlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos\ClosePlugin as PosClosePlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Scan\ClosePlugin as ScanClosePlugin; @@ -129,11 +129,11 @@ class CloseShortcut implements ShortcutInterface ]; } - protected function wapPlugins(): array + protected function h5Plugins(): array { return [ StartPlugin::class, - WapClosePlugin::class, + H5ClosePlugin::class, FormatPayloadBizContentPlugin::class, AddPayloadSignaturePlugin::class, AddRadarPlugin::class, diff --git a/src/Shortcut/Alipay/QueryShortcut.php b/src/Shortcut/Alipay/QueryShortcut.php index b02f632..e09921d 100644 --- a/src/Shortcut/Alipay/QueryShortcut.php +++ b/src/Shortcut/Alipay/QueryShortcut.php @@ -18,8 +18,8 @@ use Yansongda\Pay\Plugin\Alipay\V2\Pay\App\QueryRefundPlugin as AppQueryRefundPl use Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\QueryPlugin as AuthorizationQueryPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\QueryRefundPlugin as AuthorizationQueryRefundPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Face\QueryPlugin as FaceQueryPlugin; -use Yansongda\Pay\Plugin\Alipay\V2\Pay\H5\QueryPlugin as WapQueryPlugin; -use Yansongda\Pay\Plugin\Alipay\V2\Pay\H5\QueryRefundPlugin as WapQueryRefundPlugin; +use Yansongda\Pay\Plugin\Alipay\V2\Pay\H5\QueryPlugin as H5QueryPlugin; +use Yansongda\Pay\Plugin\Alipay\V2\Pay\H5\QueryRefundPlugin as H5QueryRefundPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini\QueryPlugin as MiniQueryPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini\QueryRefundPlugin as MiniQueryRefundPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos\QueryPlugin as PosQueryPlugin; @@ -156,11 +156,11 @@ class QueryShortcut implements ShortcutInterface ]; } - protected function wapPlugins(): array + protected function h5Plugins(): array { return [ StartPlugin::class, - WapQueryPlugin::class, + H5QueryPlugin::class, FormatPayloadBizContentPlugin::class, AddPayloadSignaturePlugin::class, AddRadarPlugin::class, @@ -200,16 +200,7 @@ class QueryShortcut implements ShortcutInterface protected function refundPlugins(): array { - return [ - StartPlugin::class, - WebQueryRefundPlugin::class, - FormatPayloadBizContentPlugin::class, - AddPayloadSignaturePlugin::class, - AddRadarPlugin::class, - VerifySignaturePlugin::class, - ResponsePlugin::class, - ParserPlugin::class, - ]; + return $this->refundWebPlugins(); } protected function refundAppPlugins(): array @@ -282,11 +273,11 @@ class QueryShortcut implements ShortcutInterface ]; } - protected function refundWapPlugins(): array + protected function refundH5Plugins(): array { return [ StartPlugin::class, - WapQueryRefundPlugin::class, + H5QueryRefundPlugin::class, FormatPayloadBizContentPlugin::class, AddPayloadSignaturePlugin::class, AddRadarPlugin::class, diff --git a/src/Shortcut/Alipay/RefundShortcut.php b/src/Shortcut/Alipay/RefundShortcut.php index 0ef84bb..0863fce 100644 --- a/src/Shortcut/Alipay/RefundShortcut.php +++ b/src/Shortcut/Alipay/RefundShortcut.php @@ -15,7 +15,7 @@ use Yansongda\Pay\Plugin\Alipay\V2\Fund\Transfer\RefundPlugin as FundTransferRef use Yansongda\Pay\Plugin\Alipay\V2\Pay\Agreement\RefundPlugin as AgreementRefundPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\App\RefundPlugin as AppRefundPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Authorization\RefundPlugin as AuthorizationRefundPlugin; -use Yansongda\Pay\Plugin\Alipay\V2\Pay\H5\RefundPlugin as WapRefundPlugin; +use Yansongda\Pay\Plugin\Alipay\V2\Pay\H5\RefundPlugin as H5RefundPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Mini\RefundPlugin as MiniRefundPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Pos\RefundPlugin as PosRefundPlugin; use Yansongda\Pay\Plugin\Alipay\V2\Pay\Scan\RefundPlugin as ScanRefundPlugin; @@ -130,11 +130,11 @@ class RefundShortcut implements ShortcutInterface ]; } - protected function wapPlugins(): array + protected function h5Plugins(): array { return [ StartPlugin::class, - WapRefundPlugin::class, + H5RefundPlugin::class, FormatPayloadBizContentPlugin::class, AddPayloadSignaturePlugin::class, AddRadarPlugin::class, diff --git a/tests/Shortcut/Alipay/CloseShortcutTest.php b/tests/Shortcut/Alipay/CloseShortcutTest.php index 82ce24f..b496ac2 100644 --- a/tests/Shortcut/Alipay/CloseShortcutTest.php +++ b/tests/Shortcut/Alipay/CloseShortcutTest.php @@ -153,9 +153,9 @@ class CloseShortcutTest extends TestCase ], $result); } - public function testWap() + public function testH5() { - $result = $this->shortcut->getPlugins(['_action' => 'wap']); + $result = $this->shortcut->getPlugins(['_action' => 'h5']); self::assertEquals([ StartPlugin::class, diff --git a/tests/Shortcut/Alipay/QueryShortcutTest.php b/tests/Shortcut/Alipay/QueryShortcutTest.php index 945d797..86d9803 100644 --- a/tests/Shortcut/Alipay/QueryShortcutTest.php +++ b/tests/Shortcut/Alipay/QueryShortcutTest.php @@ -178,9 +178,9 @@ class QueryShortcutTest extends TestCase ], $result); } - public function testWap() + public function testH5() { - $result = $this->shortcut->getPlugins(['_action' => 'wap']); + $result = $this->shortcut->getPlugins(['_action' => 'h5']); self::assertEquals([ StartPlugin::class, @@ -322,9 +322,9 @@ class QueryShortcutTest extends TestCase ], $result); } - public function testRefundWap() + public function testRefundH5() { - $result = $this->shortcut->getPlugins(['_action' => 'refund_wap']); + $result = $this->shortcut->getPlugins(['_action' => 'refund_h5']); self::assertEquals([ StartPlugin::class, diff --git a/tests/Shortcut/Alipay/RefundShortcutTest.php b/tests/Shortcut/Alipay/RefundShortcutTest.php index 06d92f8..3ac072b 100644 --- a/tests/Shortcut/Alipay/RefundShortcutTest.php +++ b/tests/Shortcut/Alipay/RefundShortcutTest.php @@ -154,9 +154,9 @@ class RefundShortcutTest extends TestCase ], $result); } - public function testWap() + public function testH5() { - $result = $this->shortcut->getPlugins(['_action' => 'wap']); + $result = $this->shortcut->getPlugins(['_action' => 'h5']); self::assertEquals([ StartPlugin::class,