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

客服接口暂时测到有3个bug,麻烦修复 #222

Closed
punlap opened this issue Jan 8, 2016 · 20 comments
Closed

客服接口暂时测到有3个bug,麻烦修复 #222

punlap opened this issue Jan 8, 2016 · 20 comments

Comments

@punlap
Copy link

punlap commented Jan 8, 2016

  1. 添加/修改客服时会报“需要HTTPS请求”这个错误

2.如果用Homestead,php版本号为“7.0.1-1+deb.sury.org~trusty+2”,版本判断会错误
那么上传客服头像时会报“curl_setopt(): Disabling safe uploads is no longer supported”

overtrue/wechat/src/Wechat/Utils/Http.php的197行
version_compare(PHP_VERSION, '5.5', '<') || curl_setopt($this->curl, CURLOPT_SAFE_UPLOAD, false);

3.删除客服,wiki中说使用
$staff->delete($email, $nickname, $password); 删除客服帐号
但overtrue/wechat/src/Wechat/Staff.php的delete方法只接收$email一个参数
如果只传$email,会报“无效客服账号(invalid kf_account)”这个错误

@xiaohome
Copy link

xiaohome commented Jan 8, 2016

@punlap 既然你用 7.0.1 你就换成 3.0版本

@overtrue
Copy link
Collaborator

overtrue commented Jan 8, 2016

overtrue added a commit that referenced this issue Jan 8, 2016
@overtrue
Copy link
Collaborator

overtrue commented Jan 8, 2016

@punlap 我发现微信的文档有两处关于客服管理的不同文档:http://mp.weixin.qq.com/wiki/11/c88c270ae8935291626538f9c64bd123.html#.E5.88.A0.E9.99.A4.E5.AE.A2.E6.9C.8D.E5.B8.90.E5.8F.B7

http://mp.weixin.qq.com/wiki/18/749901f4e123170fb8a4d447ae6040ba.html#.E5.88.A0.E9.99.A4.E5.AE.A2.E6.9C.8D.E8.B4.A6.E5.8F.B7

我改成了3个参数的形式,麻烦你试一下:

参考:a13f067 的变更改一下你的代码试试

@punlap
Copy link
Author

punlap commented Jan 8, 2016

@overtrue 好的,我试试

@punlap
Copy link
Author

punlap commented Jan 8, 2016

@xiaohome 最新下载的Homestead,默认就是7.0

@punlap
Copy link
Author

punlap commented Jan 8, 2016

@overtrue 如果传3个参数,会报参数错误,如果只填一个会报无效客服账号,是微信的问题吗?

@overtrue
Copy link
Collaborator

overtrue commented Jan 8, 2016

@punlap 这。。。,你的参数怎么填写的我看一下

@punlap
Copy link
Author

punlap commented Jan 8, 2016

@overtrue 我试了别人的SDK,也都是不行,添加/修改会报https错误,删除会报无效账号

代码:
$wechatStaff = $this->getWechat()->getStaff();
$wechatStaff->delete('anne@tengyun');

报错:
Overtrue\Wechat\Exception
[Wechat]无效客服账号(invalid kf_account)

in /data/wwwroot/local/wechat/vendor/overtrue/wechat/src/Wechat/Staff.php at line 156 – Overtrue\Wechat\Utils\Http::get('https://api.weixin.qq.com/custom...', ['kf_account' => 'anne@tengyun'])

@overtrue
Copy link
Collaborator

overtrue commented Jan 8, 2016

好吧,那估计是平台有问题吧

overtrue added a commit that referenced this issue Jan 11, 2016
@overtrue
Copy link
Collaborator

@punlap 麻烦更新后再试一下,如果没问题了请关闭此issue,谢谢!有问题就继续反馈。

@yanqing6628780
Copy link

@overtrue 这个不是平台问题.是因为程序发送向https://api.weixin.qq.com/customservice/kfaccount/del?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT的链接
kf_accout这个参数,程序把'@'这个字符转成'%40'这样就会报invalid kf_account
直接使用@字符是能删除客服成功的

@overtrue
Copy link
Collaborator

@yanqing6628780 明白

@overtrue
Copy link
Collaborator

@yanqing6628780 麻烦试一下POST方式是否可以,如果OK我直接改成POST请求

@yanqing6628780
Copy link

@overtrue
我修改了你staff.php里的delete函数的将get改为下面两个测试
$this->parseJSON('post', [self::API_DELETE, $params]);
$this->parseJSON('json', [self::API_DELETE, $params]);
测试过,都是提示{"errcode":61451,"errmsg":"invalid parameter"}

@overtrue
Copy link
Collaborator

好,明白了

overtrue added a commit that referenced this issue Jan 26, 2016
@overtrue
Copy link
Collaborator

@yanqing6628780 按我的修改一下试试:9348866

@yanqing6628780
Copy link

@overtrue
qq 20160126123127
看日志,链接没有拼接成功...

还发现个新问题是在Material.php的get函数
$response = $this->getHttp()->get(self::API_GET, ['media_id' => $mediaId]);
这里用get和post方法都会提示{"errcode":40007,"errmsg":"invalid media_id hint: [pvR35a0016e298]"}
我改成json就可以使用了
$response = $this->getHttp()->json(self::API_GET, ['media_id' => $mediaId]);
看日志,大概是因为post方法
Client Request: {"url":"https://api.weixin.qq.com/cgi-bin/material/get_material","method":"POST","options":{"form_params":{"media_id":"J6PGF3ZiDx_Uxdx7UHZ6UpUtKSjqvPzXjOH6SCsVzgo"}}} Request Body: media_id=J6PGF3ZiDx_Uxdx7UHZ6UpUtKSjqvPzXjOH6SCsVzgo
json方法
Client Request: {"url":"https://api.weixin.qq.com/cgi-bin/material/get_material","method":"POST","options":{"body":"{\"media_id\":\"J6PGF3ZiDx_Uxdx7UHZ6UpUtKSjqvPzXjOH6SCsVzgo\"}","headers":{"content-type":"application/json"}}} Request Body: {"media_id":"J6PGF3ZiDx_Uxdx7UHZ6UpUtKSjqvPzXjOH6SCsVzgo"}
而且获取永久素材这个接口http请求方式: POST

@overtrue
Copy link
Collaborator

@yanqing6628780 应该好了。

@yanqing6628780
Copy link

@overtrue 测试过没有问题了~谢谢up主

@overtrue
Copy link
Collaborator

😄
leung [email protected]于2016年1月27日 周三11:45写道:

@overtrue https://github.com/overtrue 测试过没有问题了~谢谢up主


Reply to this email directly or view it on GitHub
#222 (comment).

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

4 participants