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

生成小程序二维码报错 #2781

Closed
wds7788 opened this issue Jan 2, 2024 · 2 comments
Closed

生成小程序二维码报错 #2781

wds7788 opened this issue Jan 2, 2024 · 2 comments

Comments

@wds7788
Copy link

wds7788 commented Jan 2, 2024

我用的环境

  • PHP 版本:8.1
  • overtrue/wechat 版本:6.x
  • 是否使用了框架?框架名称:thinkphp8

问题及现象

生成小程序二维码

$response = $app->getClient()->postJson('/wxa/getwxacodeunlimit', [
'scene' => $id,
'page' => 'pages/home/home',
'width' => 430,
'check_path' => false,
]);

报错提示:EasyWeChat\Pay\Merchant::__construct(): Argument #1 ($mchId) must be of type string|int, null given, called in /www/wwwroot/lingshuigonghui/vendor/w7corp/easywechat/src/Pay/Application.php on line 53
请问怎么解决

@TheNorthMemory
Copy link
Contributor

$app->getClient()

请求的是公众号的接口,而获取的是支付的实例的吧

@wds7788
Copy link
Author

wds7788 commented Jan 2, 2024

$app->getClient()

请求公众是号的接口,而获取是支付的实例吧

是的,解决了,谢谢

@wds7788 wds7788 closed this as completed Jan 3, 2024
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