Gaoming13\WechatPhpSdk\Api::update_kf PHP Method

update_kf() public method

设置客服信息
public update_kf ( string $kf_account, string $nickname, string $password ) : array(err,
$kf_account string
$nickname string
$password string
return array(err,
    public function update_kf($kf_account, $nickname, $password)
    {
        $password = md5($password);
        $xml = sprintf('{
    			"kf_account" : "%s",
    			"nickname" : "%s",
    			"password" : "%s"}', $kf_account, $nickname, md5($password));
        $url = self::API_DOMAIN . 'customservice/kfaccount/update?access_token=' . $this->get_access_token();
        $res = HttpCurl::post($url, $xml, 'json');
        // 异常处理: 获取时网络错误
        if ($res === false) {
            return Error::code('ERR_GET');
        }
        // 判断是否调用成功
        if ($res->errcode == 0) {
            return array(null, true);
        } else {
            return array($res, null);
        }
    }