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

Return value of Yansongda\Pay\Pay::getContainer() must be an instance of Psr\Container\ContainerInterface, #1035

Open
beizhanyong opened this issue Nov 15, 2024 · 0 comments

Comments

@beizhanyong
Copy link

包版本号

3.2.0

问题描述

报错:
Return value of Yansongda\Pay\Pay::getContainer() must be an instance of Psr\Container\ContainerInterface

你的代码

[ 'default' => [ // 必填-商户号,服务商模式下为服务商商户号 'mch_id' => '', // 必填-商户秘钥 'mch_secret_key' => '', // 必填-商户私钥 字符串或路径 'mch_secret_cert' => '', // 必填-商户公钥证书路径 'mch_public_cert_path' => '', // 必填 'notify_url' => 'https://yansongda.cn/wechat/notify', // 选填-公众号 的 app_id 'mp_app_id' => '2016082000291234', // 选填-小程序 的 app_id 'mini_app_id' => '', // 选填-app 的 app_id 'app_id' => '', // 选填-合单 app_id 'combine_app_id' => '', // 选填-合单商户号 'combine_mch_id' => '', // 选填-服务商模式下,子公众号 的 app_id 'sub_mp_app_id' => '', // 选填-服务商模式下,子 app 的 app_id 'sub_app_id' => '', // 选填-服务商模式下,子小程序 的 app_id 'sub_mini_app_id' => '', // 选填-服务商模式下,子商户id 'sub_mch_id' => '', // 选填-微信公钥证书路径, optional,强烈建议 php-fpm 模式下配置此参数 'wechat_public_cert_path' => [ '45F59D4DABF31918AFCEC556D5D2C6E376675D57' => __DIR__.'/Cert/wechatPublicKey.crt', ], // 选填-默认为正常模式。可选为: MODE_NORMAL, MODE_SERVICE 'mode' => Pay::MODE_NORMAL, ] ], 'logger' => [ // optional 'enable' => false, '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](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html) ], ]; Pay::config($config); $order = [ 'out_trade_no' => time().'', 'description' => 'subject-测试', 'amount' => [ 'total' => 1, ], 'payer' => [ 'openid' => 'onkVf1FjWS5SBxxxxxxxx', ], ]; $pay = Pay::wechat($this->config)->mp($order); var_dump($pay); // $pay->appId // $pay->timeStamp // $pay->nonceStr // $pay->package // $pay->signType ## 报错详情 php index2.php PHP Fatal error: Uncaught Yansongda\Pay\Exception\ContainerException: Return value of Yansongda\Pay\Pay::getContainer() must be an instance of Psr\Container\ContainerInterface, instance of Illuminate\Container\Container returned in /var/www/maps/obj/cx/vendor/yansongda/pay/src/Pay.php:142 Stack trace: #0 /var/www/maps/obj/cx/vendor/yansongda/pay/src/Service/ContainerServiceProvider.php(63): Yansongda\Pay\Pay::set() #1 /var/www/maps/obj/cx/vendor/yansongda/pay/src/Service/ContainerServiceProvider.php(47): Yansongda\Pay\Service\ContainerServiceProvider->laravelApplication() #2 /var/www/maps/obj/cx/vendor/yansongda/pay/src/Pay.php(245): Yansongda\Pay\Service\ContainerServiceProvider->register() #3 /var/www/maps/obj/cx/vendor/yansongda/pay/src/Pay.php(257): Yansongda\Pay\Pay::registerService() #4 /var/www/maps/obj/cx/vendor/yansongda/pay/src/Pay.php(82): Yansongda\Pay\Pay->registerServices() #5 /var/www/maps/obj/cx/vendor/yansongda/pay/src/Pay.php(111): Yansongda\Pay\Pay->__construct() #6 /var/www/maps/obj/cx/index2.php(60): Yans in /var/www/maps/obj/cx/vendor/yansongda/pay/src/Pay.php on line 142 ## sdk 日志 ## nginx/apache 日志 > 涉及到 异步通知、同步通知 的问题,请贴出来
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

1 participant