检查wxticket参数
@param string $ticket
@return array
@throws Exceptions\InvalidResponseException
@throws Exceptions\LocalCacheException
972999
public function checkTicket($ticket)
    {
        $url = "https://api.weixin.qq.com/scan/scanticket/check?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['ticket' => $ticket]);
    }
1302750
public function getTicket($type = 'jsapi', $appid = null)
    {
        is_null($appid) && $appid = $this->config->get('appid');
        $cache_name = "{$appid}_ticket_{$type}";
        $ticket = Tools::getCache($cache_name);
        if (empty($ticket)) {
            $url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type={$type}";
            $this->registerApi($url, __FUNCTION__, func_get_args());
            $result = $this->httpGetForJson($url);
            if (empty($result['ticket'])) {
                throw new InvalidResponseException('Invalid Resoponse Ticket.', '0');
            }
            $ticket = $result['ticket'];
            Tools::setCache($cache_name, $ticket, 5000);
        }
        return $ticket;
    }
570423
public static BufferedImage showqrcode(String ticket){
		HttpUriRequest httpUriRequest = RequestBuilder.get()
				.setUri(MP_URI + "/cgi-bin/showqrcode")
				.addParameter("ticket", ticket)
				.build();
		CloseableHttpResponse httpResponse = LocalHttpClient.execute(httpUriRequest);
		return getImage(httpResponse);
	}
1346922
public function validate($ticketCode = null)
    {
        if (filter_var($ticketCode, FILTER_VALIDATE_URL)) {
            $asURL = explode('/', parse_url($ticketCode, PHP_URL_PATH));
            $ticketCode = end($asURL);
        }

        // Check if a code is given to the validator
        if (!isset($ticketCode)) {
            return $result = array(
                'Code' => self::MESSAGE_NO_CODE,
                'Message' => self::message(self::MESSAGE_NO_CODE, $ticketCode),
                'Type' => self::MESSAGE_TYPE_BAD,
                'Ticket' => $ticketCode,
                'Attendee' => null
            );
        }

        // Check if a ticket exists with the given ticket code
        if (!$this->attendee = Attendee::get()->find('TicketCode', $ticketCode)) {
            return $result = array(
                'Code' => self::MESSAGE_CODE_NOT_FOUND,
                'Message' => self::message(self::MESSAGE_CODE_NOT_FOUND, $ticketCode),
                'Type' => self::MESSAGE_TYPE_BAD,
                'Ticket' => $ticketCode,
                'Attendee' => null
            );
        } else {
            $name = $this->attendee->getName();
        }

        // Check if the reservation is not canceled
        if (!(bool)$this->attendee->Event()->getGuestList()->find('ID', $this->attendee->ID)) {
            return $result = array(
                'Code' => self::MESSAGE_TICKET_CANCELLED,
                'Message' => self::message(self::MESSAGE_TICKET_CANCELLED, $name),
                'Type' => self::MESSAGE_TYPE_BAD,
                'Ticket' => $ticketCode,
                'Attendee' => $this->attendee
            );
        }

        // Check if the ticket is already checked in and not allowed to check out
        elseif ((bool)$this->attendee->CheckedIn && !(bool)self::config()->get('allow_checkout')) {
            return $result = array(
                'Code' => self::MESSAGE_ALREADY_CHECKED_IN,
                'Message' => self::message(self::MESSAGE_ALREADY_CHECKED_IN, $name),
                'Type' => self::MESSAGE_TYPE_BAD,
                'Ticket' => $ticketCode,
                'Attendee' => $this->attendee
            );
        }

        // Successfully checked out
        elseif ((bool)$this->attendee->CheckedIn && (bool)self::config()->get('allow_checkout')) {
            return $result = array(
                'Code' => self::MESSAGE_CHECK_OUT_SUCCESS,
                'Message' => self::message(self::MESSAGE_CHECK_OUT_SUCCESS, $name),
                'Type' => self::MESSAGE_TYPE_WARNING,
                'Ticket' => $ticketCode,
                'Attendee' => $this->attendee
            );
        }

        // Successfully checked in
        else {
            return $result = array(
                'Code' => self::MESSAGE_CHECK_IN_SUCCESS,
                'Message' => self::message(self::MESSAGE_CHECK_IN_SUCCESS, $name),
                'Type' => self::MESSAGE_TYPE_GOOD,
                'Ticket' => $ticketCode,
                'Attendee' => $this->attendee
            );
        }
    }
57833
public function showQRCode($ticket = null)
    {
        $params = [
            'ticket' => $ticket,
        ];

        $http = $this->getHttp();

        /** @var ResponseInterface $response */
        $response = $http->get(self::API_SHOW_QRCODE, $params);

        return [
            'status'  => $response->getStatusCode(),
            'reason'  => $response->getReasonPhrase(),
            'headers' => $response->getHeaders(),
            'body'    => strval($response->getBody()),
            'url'     => self::API_SHOW_QRCODE.'?'.http_build_query($params),
        ];
    }
233860
public static function fromProto(ProtoAuthTicket $ticket) : self
    {
        return new self($ticket->getStart()->getContents(), $ticket->getEnd()->getContents(), $ticket->getExpireTimestampMs());
    }
859278
public function updateTicket(TicketInterface $ticket, TicketMessageInterface $message = null)
    {
        $this->storageManager('persist', $ticket);

        if (is_null($ticket->getId())) {
            $this->fireEvent(TicketEvents::TICKET_CREATE, $ticket);
            $this->storageManager('persist', $ticket);
        } else {
            $this->fireEvent(TicketEvents::TICKET_UPDATE, $ticket);
        }

        if (!\is_null($message)) {
            $message->setTicket($ticket);
            $this->storageManager('persist', $message);
        }

        $this->storageManager('flush');

        return $ticket;
    }
1187112
public function getJsCardTicket($appid = '', $jsapi_ticket = '')
    {
        if (!$this->access_token && !$this->getAccessToken()) {
            return false;
        }
        $appid = empty($appid) ? $this->appid : $appid;
        if ($jsapi_ticket) {
            return $jsapi_ticket;
        }
        $authname = 'wechat_jsapi_ticket_wxcard_' . $appid;
        if (($jsapi_ticket = Tools::getCache($authname))) {
            return $jsapi_ticket;
        }
        $result = Tools::httpGet(self::API_URL_PREFIX . self::GET_TICKET_URL . "access_token={$this->access_token}&type=wx_card");
        if ($result) {
            $json = json_decode($result, true);
            if (empty($json) || !empty($json['errcode'])) {
                $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505';
                $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解析接口返回内容！';
                return $this->checkRetry(__FUNCTION__, func_get_args());
            }
            $expire = $json['expires_in'] ? intval($json['expires_in']) - 100 : 3600;
            Tools::setCache($authname, $json['ticket'], $expire);
            return $json['ticket'];
        }
        return false;
    }
467056
public function getTicket()
    {
        if ($this->ticket) {
            return $this->ticket;
        }

        $key = 'gibson.wechat.card.api_ticket';

        // for php 5.3
        $http = $this->http;
        $apiTicket = self::API_TICKET;

        return $this->ticket = Cache::get($key, function () use ($key, $http, $apiTicket) {
            $result = $http->get($apiTicket);

            Cache::put($key, $result['ticket'], $result['expires_in']);

            return $result['ticket'];
        });
    }
575651
function getSubmissionId($submissionTicket) {
		$submission = $this->getSubmission($submissionTicket);
		if (isset($submission)) {
			return $submission->submissionId;
		} else {
			throw new Exception("Invalid submission ticket");
		}
	}
526719
function __fetchTicketInfo(server, ticketid, callback) {

    assert(server.cache_folder);

    var filename = server._ticket_cache_file(ticketid);
    //xx console.log("filename " , filename.red);

    assert(_.isFunction(callback));

    var command = 'issues/' + ticketid.toString() + '.json?include=relations,journals';

    perform_http_get_transaction(server,command, function (err, txt) {

        txt = fixUnicode(txt);

        var ticket = null;
        try {
            var o = JSON.parse(txt);

            fs.writeFileSync(filename, JSON.stringify(o, null, " "));
            console.warn(" writing ", filename);
            ticket= o.issue;
        } catch (err) {
            console.log("error !".red, err.message);
            fs.writeFileSync("toto.txt", txt);
            callback(err);
            return;
            // the ticket may have been deleted
        }
        callback(null,ticket);

    });

}
995635
public function getJsApiTicket($force = false)
    {
        $time = time(); // 为了更精确控制.取当前时间计算
        $cache_name = 'wechat_jsapi_ticket_' . $this->corpId . '_' . $this->app;
        if ($this->_jsApiTicket === null || $this->_jsApiTicket['expire'] < $time || $force) {
            $result = $this->_jsApiTicket === null && !$force ? $this->getCache($cache_name, false) : false;
            if ($result === false) {
                if (!($result = $this->requestJsApiTicket())) {
                    throw new HttpException(500, 'Fail to get jsapi_ticket from wechat server.');
                }
                $result['expire'] = $time + $result['expires_in'];
                $this->trigger(self::EVENT_AFTER_JS_API_TICKET_UPDATE, new Event(['data' => $result]));
                $this->setCache($cache_name, $result, $result['expires_in']);
            }
            $this->setJsApiTicket($result);
        }
        return $this->_jsApiTicket['ticket'];
    }
441436
public function confirmDestroy(Ticket $ticket)
    {
        $this->authorize('delete', $ticket);

        return view('laralum::pages.confirmation', [
            'method'  => 'DELETE',
            'message' => __('laralum_tickets::general.sure_del_ticket', ['id' => $ticket->id]),
            'action'  => route('laralum::tickets.destroy', ['ticket' => $ticket->id]),
        ]);
    }
74839
def cache_component_verify_ticket(self, msg, signature, timestamp, nonce):
        
        warnings.warn('`cache_component_verify_ticket` method of `WeChatComponent` is deprecated,'
                      'Use `parse_message` instead',
                      DeprecationWarning, stacklevel=2)
        content = self.crypto.decrypt_message(msg, signature, timestamp, nonce)
        message = xmltodict.parse(to_text(content))['xml']
        o = ComponentVerifyTicketMessage(message)
        self.session.set(o.type, o.verify_ticket)
836854
public function getStatus($ticket)
    {
        try {
            return $this->getStatusInternal($ticket);
        } catch (\SoapFault $e) {
            $result = new StatusResult();
            $result->setError($this->getErrorFromFault($e));

            return $result;
        }
    }
982309
public static TicketCheckResult ticketCheck(String accessToken, String ticket) {
        HttpUriRequest httpUriRequest = RequestBuilder.post()
                .setHeader(jsonHeader)
                .setUri(BASE_URI + "/scan/scanticket/check")
                .addParameter(PARAM_ACCESS_TOKEN, API.accessToken(accessToken))
                .addParameter("ticket", ticket)
                .build();
        return LocalHttpClient.executeJsonResult(httpUriRequest,
                TicketCheckResult.class);
    }
948951
public Shake get(String ticket) {
        String url = WxEndpoint.get("url.shake.get");
        String body = String.format("{\"ticket\":\"%s\"}", ticket);
        logger.debug("get shake info: {}", body);
        String content = wxClient.post(url, body);
        ShakeWrapper shakeWrapper = JsonMapper.nonEmptyMapper().fromJson(content, ShakeWrapper.class);
        return shakeWrapper.getData();
    }