protected function createQRCodeTicket($value, $type)
    {
        $url    = sprintf(self::QR_CODE_URL, $this->getAccessTokenString());
        $client = $this->getHttpClient();
        $client->setUrl($url);
        $client->setHeaderArray(['Content-Type: application/json']);
        $client->setMethod(Client::METHOD_POST);
        $str    = '{"expire_seconds": ' . self::QR_CODE_EXPIRE_TIME . ', "action_name": "%s", "action_info": {"scene": {"scene_id": %d}}}';
        $msg    = sprintf($str, $type, $value);
        $client->setPostFields($msg);
        if (!$client->exec()) {
            throw new Exception("call send custom service message fail");
        }

        $result = json_decode($client->getResponse(), true);

        if (isset($result['errcode'])) {
            throw new Exception("error response for createQRCodeTicket " . $result['errmsg']);
        }

        return $result;
    }