卡券详情.

@param string $cardId

@return Bag
19222
public function get($cardId)
    {
        $params = array('card_id' => $cardId);

        $result = $this->http->jsonPost(self::API_GET, $params);

        return new Bag($result['card']);
    }
420455
public function getToken($tokenId) {

		if($this->storage->hasToken($tokenId)) {
			return $this->storage->getToken($tokenId);
		}

		$token = new CsrfToken(
			$tokenId,
			$this->generateValue((int) $this->tokenLength)
		);

		$this->storage->setToken($tokenId, $token);

		return $token;
	}
685993
public function getBank($bankID)
    {
        if (! isset($this->instances[$bankID])) {
            $this->instances[$bankID] = $this->getNewBank($bankID);

        }
        return $this->instances[$bankID];
    }
1300488
public function getCard($userId, $cardId)
    {
        $card = $this->client->get($this->getResourceEndpoint($userId) . '/' . (int)$cardId);

        return $card['Response'][0];
    }
221958
public function setActivationForm(string $cardId, array $settings)
    {
        $params = array_merge(['card_id' => $cardId], $settings);

        return $this->httpPostJson('card/membercard/activateuserform/set', $params);
    }
477834
public function createChooseCardJsPackage($cardid = null, $cardtype = null, $shopid = null)
    {
        $data = array();
        $data['api_ticket'] = $this->getJsCardTicket();
        $data['app_id'] = $this->appid;
        $data['timestamp'] = time();
        $data['nonceStr'] = Tools::createNoncestr();
        !empty($cardid) && $data['cardId'] = $cardid;
        !empty($cardtype) && $data['cardType'] = $cardtype;
        !empty($shopid) && $data['shopId'] = $shopid;
        $data['cardSign'] = $this->getTicketSignature($data);
        $data['signType'] = 'SHA1';
        unset($data['api_ticket'], $data['app_id']);
        return $data;
    }
964555
public function getUser(string $cardId, string $code)
    {
        $params = [
            'card_id' => $cardId,
            'code' => $code,
        ];

        return $this->httpPostJson('card/membercard/userinfo/get', $params);
    }
964951
public function getCard($cardID)
    {
        $tokenContext = new TokenContext("", 'get');
        $token = $this->accessTokenProvider->getToken($tokenContext);

        $responseModel = $this->cardClient->getCard($cardID, (string)$token);
        if ($responseModel instanceof ErrorResponseModel) {
            throw new CardClientException(
                "error response from card service", $responseModel->getCode(), $responseModel->getMessage()
            );
        }

        $card = $this->parseRawCard($responseModel->getRawSignedModel(), $responseModel->isOutdated());

        if (!$this->cardVerifier->verifyCard($card)) {
            throw new CardVerificationException('Validation errors have been detected');
        }

        return $card;
    }
732998
public function getById(string $cartId): Checkout
    {
        $qb = $this->connection->createQueryBuilder();
        $qb->select(
            'id', 'billing_address_name', 'billing_address_street', 'billing_address_post_code', 'billing_address_city',
            'billing_address_country_iso2code', 'shipping_address_name', 'shipping_address_street',
            'shipping_address_post_code', 'shipping_address_city', 'shipping_address_country_iso2code'
        )
            ->from('dumplie_customer_checkout')
            ->where('id = :id')
            ->setParameter('id', $cartId);

        $checkoutData = $this->connection->fetchAssoc($qb->getSQL(), $qb->getParameters());

        if (empty($checkoutData)) {
            throw QueryException::cartNotFound($cartId);
        }

        return new Checkout(
            new CartId($cartId),
            new Address(
                $checkoutData['billing_address_name'],
                $checkoutData['billing_address_street'],
                $checkoutData['billing_address_post_code'],
                $checkoutData['billing_address_city'],
                $checkoutData['billing_address_country_iso2code']
            ),
            new Address(
                $checkoutData['shipping_address_name'],
                $checkoutData['shipping_address_street'],
                $checkoutData['shipping_address_post_code'],
                $checkoutData['shipping_address_city'],
                $checkoutData['shipping_address_country_iso2code']
            )
        );
    }
969918
public function lists($departmentId, $fetchChild = 1, $status = 1)
    {
        $params = array(
                    'department_id'     => $departmentId,
                    'fetch_child'       => $fetchChild,
                    'status'            => $status,
                );

        return new Bag($this->http->get(self::API_LIST, $params));
    }
1289621
public function getRevCardDel(){
        if (isset($this->_receive['CardId']))     //卡券 ID
            $array['CardId'] = $this->_receive['CardId'];
        if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) //code 序列号。自定义 code 及非自定义 code的卡券被领取后都支持事件推送。
            $array['UserCardCode'] = $this->_receive['UserCardCode'];
        if (isset($array) && count($array) > 0) {
            return $array;
        } else {
            return false;
        }
    }
502654
public function put($cardData)
    {
        if (is_resource($cardData)) {
            $cardData = stream_get_contents($cardData);
        }

        // Converting to UTF-8, if needed
        $cardData = DAV\StringUtil::ensureUTF8($cardData);

        $etag = $this->carddavBackend->updateCard($this->addressBookInfo['id'], $this->cardData['uri'], $cardData);
        $this->cardData['carddata'] = $cardData;
        $this->cardData['etag'] = $etag;

        return $etag;
    }
1369750
public function setCard($id, $cardId)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/idCard', array('value' => $cardId));
    }
733354
public function sheetById(string $sheetId)
    {
        $list = $this->sheetList();

        $sheet = Arr::get($list, $sheetId);

        $this->sheet = $sheet;

        return $this;
    }
772996
public function deleteCard($card_id)
    {
        $url = "https://api.weixin.qq.com/card/delete?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['card_id' => $card_id]);
    }
1336768
public function getCard($cardId)
    {
        if (!$this->stripe_id) {
            return null;
        }

        $customer = $this->asStripeCustomer();

        foreach ($customer->sources->data as $card) {
            if ($card->id === $cardId) {
                return $card;
            }
        }

        return null;
    }
357627
public function deposit(string $cardId, array $codes)
    {
        $params = [
            'card_id' => $cardId,
            'code' => $codes,
        ];

        return $this->httpPostJson('card/code/deposit', $params);
    }