Closed 36D-CUP closed 7 months ago
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}" ] },
涉及到 异步通知、同步通知 的问题,请贴出来
升级到最新版
最新版是需要php8.0才可以吗,我现在的项目是7.4,项目比较大,不考虑升级8.0,这种情况还能继续使用吗
那安装下 monlog 就行
包版本号
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);
报错详情
{ "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 日志