Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3版本没有\Psr\EventDispatcher\EventDispatcherInterface这个类,后提示config error #919

Closed
36D-CUP opened this issue Jan 3, 2024 · 3 comments

Comments

@36D-CUP
Copy link

36D-CUP commented Jan 3, 2024

包版本号

v3版本

问题描述

希望能得到帮忙~谢谢!!
我config个后调用生成find显示出config error,我发现event.php里面的\Psr\EventDispatcher\EventDispatcherInterface不存在

你的代码

$config = [
'appid' => '', // APP APPID
'app_id' => '', // 公众号 APPID
'miniapp_id' => '', // 小程序 APPID
'mch_id' => 'xxxx',
'key' => 'xxxxx',
'notify_url' => '',
'cert_client' => '', // optional, 退款,红包等情况时需要用到
'cert_key' => '',// optional, 退款,红包等情况时需要用到
'log' => [ // optional
'file' => './logs/wechat.log',
'level' => 'info', // 建议生产环境等级调整为 info,开发环境为 debug
'type' => 'single', // optional, 可选 daily.
'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天
],
'http' => [ // optional
'timeout' => 5.0,
'connect_timeout' => 5.0,
// 更多配置项请参考 Guzzle
],
// 'mode' => 'dev',
];
Pay::config($config);

    $result = Pay::wechat($config)->find('out_trade_no_123456');

报错详情

{
"type": "Yansongda\Pay\Exception\InvalidConfigException",
"file": "E:\wwwroot\xingyun_rg\vendor\yansongda\pay\src\Event.php",
"errorMessage": "Config Error",
"line": 34,
"stack-trace": [
"#0 E:\wwwroot\xingyun_rg\vendor\yansongda\pay\src\Provider\Wechat.php(71): Yansongda\Pay\Event::__callStatic('dispatch', Array)",
"#1 E:\wwwroot\xingyun_rg\addons\BusinessCards\api\modules\v1\controllers\cards\CardsController.php(449): Yansongda\Pay\Provider\Wechat->find(Array)",
"#2 [internal function]: addons\BusinessCards\api\modules\v1\controllers\cards\CardsController->actionTest()",
"#3 E:\wwwroot\xingyun_rg\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)",
"#4 E:\wwwroot\xingyun_rg\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\InlineAction->runWithParams(Array)",
"#5 E:\wwwroot\xingyun_rg\vendor\yiisoft\yii2\base\Module.php(534): yii\base\Controller->runAction('test', Array)",
"#6 E:\wwwroot\xingyun_rg\vendor\yiisoft\yii2\web\Application.php(104): yii\base\Module->runAction('business-cards/...', Array)",
"#7 E:\wwwroot\xingyun_rg\vendor\yiisoft\yii2\base\Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))",
"#8 E:\wwwroot\xingyun_rg\web\api\index.php(35): yii\base\Application->run()",
"#9 {main}"
]
},

sdk 日志

nginx/apache 日志

涉及到 异步通知、同步通知 的问题,请贴出来

@yansongda
Copy link
Owner

升级到最新版

#833

@36D-CUP
Copy link
Author

36D-CUP commented Jan 3, 2024

最新版是需要php8.0才可以吗,我现在的项目是7.4,项目比较大,不考虑升级8.0,这种情况还能继续使用吗

@yansongda
Copy link
Owner

那安装下 monlog 就行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants