fix: 微信查询插件退款查询问题 (#933)

This commit is contained in:
yansongda 2024-01-21 17:03:02 +08:00 committed by GitHub
parent 439d1b13a4
commit 39227bff44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 92 additions and 18 deletions

View File

@ -20,7 +20,7 @@
- change: 手机网站支付快捷方式由 wap 改为 h5(#911, #915, #916)
- change: `Pay` 类对外方法由所改变,如果您有自行扩展相关插件,请检查(#926)
- change(internal): 按场景对 支付宝/微信/银联 插件进行分类 && 插件代码优化(#894, #909, #913, #922)
- change(internal): 将 支付/微信/银联 shortcut 从 plugin 文件夹独立出来(#895, #904, #905)
- change(internal): 将 支付/微信/银联 shortcut 从 plugin 文件夹独立出来(#895, #904, #905, #933)
- change(internal): shortcut 完整标明各个插件,不使用 commonPlugin(#886)
- change(internal): DirectionInterface 方法由 `parse` 改为 `guide`(#896)
- change(internal): 错误代码 const 命名规则统一(#902, #903, #906, #909, #926)

View File

@ -15,17 +15,17 @@ use Yansongda\Pay\Plugin\Wechat\StartPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\AddPayloadSignaturePlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Marketing\Transfer\QueryDetailPlugin as TransferQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\App\QueryPlugin as AppQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\App\RefundPlugin as AppRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\App\QueryRefundPlugin as AppQueryRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Combine\QueryPlugin as CombineQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Combine\RefundPlugin as CombineRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Combine\QueryRefundPlugin as CombineQueryRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\H5\QueryPlugin as H5QueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\H5\RefundPlugin as H5RefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\H5\QueryRefundPlugin as H5QueryRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Jsapi\QueryPlugin as JsapiQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Jsapi\RefundPlugin as JsapiRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Jsapi\QueryRefundPlugin as JsapiQueryRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Mini\QueryPlugin as MiniQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Mini\RefundPlugin as MiniRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Mini\QueryRefundPlugin as MiniQueryRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Native\QueryPlugin as NativeQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Native\RefundPlugin as NativeRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Native\QueryRefundPlugin as NativeQueryRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\VerifySignaturePlugin;
use Yansongda\Supports\Str;
@ -147,7 +147,7 @@ class QueryShortcut implements ShortcutInterface
{
return [
StartPlugin::class,
AppRefundPlugin::class,
AppQueryRefundPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
@ -161,7 +161,7 @@ class QueryShortcut implements ShortcutInterface
{
return [
StartPlugin::class,
CombineRefundPlugin::class,
CombineQueryRefundPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
@ -175,7 +175,7 @@ class QueryShortcut implements ShortcutInterface
{
return [
StartPlugin::class,
H5RefundPlugin::class,
H5QueryRefundPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
@ -189,7 +189,7 @@ class QueryShortcut implements ShortcutInterface
{
return [
StartPlugin::class,
JsapiRefundPlugin::class,
JsapiQueryRefundPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
@ -203,7 +203,7 @@ class QueryShortcut implements ShortcutInterface
{
return [
StartPlugin::class,
MiniRefundPlugin::class,
MiniQueryRefundPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
@ -217,7 +217,7 @@ class QueryShortcut implements ShortcutInterface
{
return [
StartPlugin::class,
NativeRefundPlugin::class,
NativeQueryRefundPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,

View File

@ -13,9 +13,13 @@ use Yansongda\Pay\Plugin\Wechat\ResponsePlugin;
use Yansongda\Pay\Plugin\Wechat\StartPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\AddPayloadSignaturePlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Marketing\Transfer\QueryDetailPlugin as TransferQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\App\QueryPlugin as AppQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Combine\QueryPlugin as CombineQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\H5\QueryPlugin as H5QueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Jsapi\QueryPlugin as JsapiQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Jsapi\RefundPlugin as JsapiRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Jsapi\QueryRefundPlugin as JsapiQueryRefundPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Mini\QueryPlugin as MiniQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\Pay\Native\QueryPlugin as NativeQueryPlugin;
use Yansongda\Pay\Plugin\Wechat\V3\VerifySignaturePlugin;
use Yansongda\Pay\Shortcut\Wechat\QueryShortcut;
use Yansongda\Pay\Tests\TestCase;
@ -45,18 +49,18 @@ class QueryShortcutTest extends TestCase
], $this->plugin->getPlugins([]));
}
public function testRefund()
public function testApp()
{
self::assertEquals([
StartPlugin::class,
JsapiRefundPlugin::class,
AppQueryPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
ResponsePlugin::class,
VerifySignaturePlugin::class,
ParserPlugin::class,
], $this->plugin->getPlugins(['_action' => 'refund']));
], $this->plugin->getPlugins(['_action' => 'app']));
}
public function testCombine()
@ -87,6 +91,76 @@ class QueryShortcutTest extends TestCase
], $this->plugin->getPlugins(['combine_out_trade_no' => '123abc']));
}
public function testH5()
{
self::assertEquals([
StartPlugin::class,
H5QueryPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
ResponsePlugin::class,
VerifySignaturePlugin::class,
ParserPlugin::class,
], $this->plugin->getPlugins(['_action' => 'h5']));
}
public function testJsapi()
{
self::assertEquals([
StartPlugin::class,
JsapiQueryPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
ResponsePlugin::class,
VerifySignaturePlugin::class,
ParserPlugin::class,
], $this->plugin->getPlugins(['_action' => 'jsapi']));
}
public function testMini()
{
self::assertEquals([
StartPlugin::class,
MiniQueryPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
ResponsePlugin::class,
VerifySignaturePlugin::class,
ParserPlugin::class,
], $this->plugin->getPlugins(['_action' => 'mini']));
}
public function testNative()
{
self::assertEquals([
StartPlugin::class,
NativeQueryPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
ResponsePlugin::class,
VerifySignaturePlugin::class,
ParserPlugin::class,
], $this->plugin->getPlugins(['_action' => 'native']));
}
public function testRefund()
{
self::assertEquals([
StartPlugin::class,
JsapiQueryRefundPlugin::class,
AddPayloadBodyPlugin::class,
AddPayloadSignaturePlugin::class,
AddRadarPlugin::class,
ResponsePlugin::class,
VerifySignaturePlugin::class,
ParserPlugin::class,
], $this->plugin->getPlugins(['_action' => 'refund']));
}
public function testTransfer()
{
self::assertEquals([
@ -109,4 +183,4 @@ class QueryShortcutTest extends TestCase
$this->plugin->getPlugins(['_action' => 'foo']);
}
}
}