ticket 换取二维码图片.

@param string $ticket

@return array
334725
public function getQrCode($ticket)
    {
        $baseUri = 'https://mp.weixin.qq.com/cgi-bin/showqrcode';
        $params = [
            'ticket' => $ticket,
        ];

        $response = $this->requestRaw($baseUri, 'GET', $params);

        return [
            'status' => $response->getStatusCode(),
            'reason' => $response->getReasonPhrase(),
            'headers' => $response->getHeaders(),
            'body' => strval($response->getBody()),
            'url' => $baseUri.'?'.http_build_query($params),
        ];
    }
984555
def parse(self, ticket):
        
        if len(ticket) < self._min_ticket_size():
            raise TicketParseError(ticket, 'Invalid ticket length')

        digest_len = self._hash.digest_size * 2
        digest = ticket[:digest_len]

        try:
            time_len = 8
            time = int(ticket[digest_len:digest_len + time_len], 16)
        except:
            raise TicketParseError(ticket, 'Invalid time field')

        parts = ticket[digest_len + time_len:].split('!')
        if len(parts) != 3:
            raise TicketParseError(ticket, 'Missing parts')

        user_id = ulp.unquote(parts[0])
        tokens = ()
        if parts[1]:
            tokens = tuple((ulp.unquote(t) for t in parts[1].split(',')))

        user_data = ulp.unquote(parts[2])

        return TicketInfo(digest, user_id, tokens, user_data, time)
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);
	}
521323
public function new_jsapi_ticket()
    {
        $url = self::API_DOMAIN . 'cgi-bin/ticket/getticket?access_token=' . $this->get_access_token() . '&type=jsapi';
        $res = HttpCurl::get($url, 'json');
        // 异常处理: 获取时网络错误
        if ($res === false) {
            return Error::code('ERR_GET');
        }
        // 判断是否调用成功
        if ($res->errcode == 0) {
            return (object)array(
                'ticket' => $res->ticket,
                'expires_in' => $res->expires_in + time()
            );
        } else {
            return false;
        }
    }
1034321
public function open(Ticket $ticket)
    {
        $this->authorize('publicStatus', $ticket);
        $ticket->update([
            'open' => true,
        ]);

        return redirect()->route('laralum_public::tickets.index')->with('success', __('laralum_tickets::general.reopened', ['id' => $ticket->id]));
    }
567195
function sendDownloadConfirmation($ticket) {
		$sendDownloadConfirmationRequest = new sendDownloadConfirmation ();
		
		$sendDownloadConfirmationRequest->targetId = $ticket;
		
		return $this->targetService->sendDownloadConfirmation ( $sendDownloadConfirmationRequest )->return;
	}
683702
public function getTicket(): string
    {
        if ($cached = $this->getCache()->get($this->getCacheKey())) {
            return $cached;
        }

        throw new RuntimeException('Credential "suite_ticket" does not exist in cache.');
    }
920185
public function getTicket()
    {
        $key    = 'JSAPI_TICKET' . $this->getAppId();
        $ticket = $this->cache($key);
        if (!$ticket) {
            $this->module = 'ticket';
            $queryStr     = [
                'type' => 'jsapi',
            ];
            $res          = $this->_get('getticket', $queryStr, false);

            if (!$res) {
                return false;
            }

            $ticket  = $res['ticket'];
            $expires = $res['expires_in'];

            $this->cache($key, $ticket, $expires - 1000);
        }

        return $ticket;
    }
606409
private static int getTimeToLive(final Ticket ticket) {
        val expTime = ticket.getExpirationPolicy().getTimeToLive().intValue();
        if (TimeUnit.SECONDS.toDays(expTime) >= MAX_EXP_TIME_IN_DAYS) {
            LOGGER.warn("Any expiration time larger than [{}] days in seconds is considered absolute (as in a Unix time stamp) "
                + "anything smaller is considered relative in seconds.", MAX_EXP_TIME_IN_DAYS);

        }
        return expTime;
    }
1257134
public function update(TicketObject $ticket) {
        return new TicketObject($this->client->post('tickets/' . $ticket->guid, array("ticket" => $ticket)));
    }
689044
def verify_ticket(self, ticket):
        """"""
        (response, charset) = self.get_verification_response(ticket)
        return self.verify_response(response, charset)
928058
def get_qrcode_url(self, ticket, data=None):
        
        url = 'https://we.qq.com/d/{ticket}'.format(ticket=ticket)
        if data:
            if isinstance(data, (dict, tuple, list)):
                data = urllib.urlencode(data)
            data = to_text(base64.b64encode(to_binary(data)))
            url = '{base}#{data}'.format(base=url, data=data)
        return url
419439
public function getTicketQuantities() {
		$quantities = array();
		foreach($this->Tickets() as $ticket){
			$quantities[$ticket->ID] = $this->Attendees()
				->filter("TicketID", $ticket->ID)
				->count();
		}
		return $quantities;
	}
417092
private function _renameSession($ticket)
    {
        phpCAS::traceBegin();
        if ($this->getChangeSessionID()) {
            if (!empty($this->_user)) {
                $old_session = $_SESSION;
                phpCAS :: trace("Killing session: ". session_id());
                session_destroy();
                // set up a new session, of name based on the ticket
                $session_id = $this->_sessionIdForTicket($ticket);
                phpCAS :: trace("Starting session: ". $session_id);
                session_id($session_id);
                session_start();
                phpCAS :: trace("Restoring old session vars");
                $_SESSION = $old_session;
            } else {
                phpCAS :: trace (
                    'Session should only be renamed after successfull authentication'
                );
            }
        } else {
            phpCAS :: trace(
                "Skipping session rename since phpCAS is not handling the session."
            );
        }
        phpCAS::traceEnd();
    }
732779
public function getGroupTicket()
    {
        $key = 'stoneworld.wechat.group_ticket.' . $this->appId;

        // for php 5.3
        $appId = $this->appId;
        $appSecret = $this->appSecret;
        $cache = $this->cache;
        $apiTicket = self::API_TICKET_CONTACT;

        return $this->cache->get(
            $key,
            function ($key) use ($appId, $appSecret, $cache, $apiTicket) {
                $http = new Http(new AccessToken($appId, $appSecret));

                $result = $http->get($apiTicket);

                $cache->set($key, $result, $result['expires_in']);

                return $result;
            }
        );
    }
546808
public function get_js_api_ticket(){
        /*使用业务接口获取缓存中的js_api_ticket避免频繁调用接口刷新js_api_ticket*/
        if ($this->business_interface){
            $js_api_ticket = $this -> business_interface -> get_cache_js_api_ticket();
            if (!empty($js_api_ticket)){
                return $js_api_ticket;
            }
        }
        return $this->refresh_js_api_ticket();
    }
953863
private function saveTicket($ticket, $expire)
    {
        $data   = ['ticket' => $ticket, 'expire' => intval($expire), 'time' => time()];
        return ($this->getFileSystem()->put($this->getTicketFilePath(), serialize($data), true) > 0);
    }