更改Code接口.

@param string $code
@param string $newCode
@param string $cardId

@return mixed
542389
public function update(string $code, string $newCode, string $cardId = '')
    {
        $params = [
            'code' => $code,
            'new_code' => $newCode,
            'card_id' => $cardId,
        ];

        return $this->httpPostJson('card/code/update', $params);
    }
964555
public function getUser(string $cardId, string $code)
    {
        $params = [
            'card_id' => $cardId,
            'code' => $code,
        ];

        return $this->httpPostJson('card/membercard/userinfo/get', $params);
    }
887509
public function update(string $cardId, string $encryptCode, string $status)
    {
        $params = [
            'card_id' => $cardId,
            'encrypt_code' => $encryptCode,
            'reimburse_status' => $status,
        ];

        return $this->httpPostJson('cgi-bin/card/invoice/reimburse/updateinvoicestatus', $params);
    }
819812
String getContentByCardId(String cardId) {
        Map<String, Object> request = new HashMap<>();
        request.put("card_id", cardId);

        String url = WxEndpoint.get("url.card.mpnews.gethtml");
        String json = JsonMapper.defaultMapper().toJson(request);
        logger.debug("get mpnews content by card id: {}", json);
        String response = wxClient.post(url, json);
        Map<String, Object> result = JsonMapper.defaultMapper().json2Map(response);
        if (result.containsKey("content")) {
            return result.get("content").toString();
        } else {
            throw new WxRuntimeException(999, "get html content by card id failed.");
        }
    }
525417
public static function load($cardId) {
    $card = Core::$store->read('otp-card', $cardId);
    if($card !== false) {
      if($card['hash'] !== hash(self::HASH_TYPE, $card['list'])) {
        return false;
      }
      $card['list'] = json_decode(base64_decode($card['list']), true);
      return $card;
    }
    return false;
  }
1316749
public function consume($code, $cardId = null)
    {
        $params = array(
            'code' => $code,
            'card_id' => $cardId,
        );

        return new Bag($this->http->jsonPost(self::API_CONSUME, $params));
    }
535897
public function code ( $code = NULL ) {
      if ( $code === NULL )
        return $this->code;
      if ( ResponseCode::find( $code ) === NULL )
        throw new \InvalidArgumentException( "Response: no code $code" );
      $this->code = intval( $code );
      return $this;
    }
660212
public function getIdByCode($alias, $code, $id_only = true, array $options = []) {
		$class = $this->data[$alias]['no_data_alias_model'];
		$model = new $class();
		$columns = [];
		if ($id_only) {
			$columns[] = $model->column_prefix . 'id';
		}
		$data = $model->get([
			'columns' => $columns,
			'where' => [
				$this->data[$alias]['no_data_alias_column'] => $code . ''
			],
			'pk' => null,
			'skip_acl' => $options['skip_acl'] ?? false,
			'no_cache' => true,
		]);
		// if we have results we need to make it single row
		if (isset($data[0])) {
			$data = $data[0];
		}
		if (!$id_only) {
			return $data;
		} else {
			return $data[$model->column_prefix . 'id'] ?? null;
		}
	}
150209
public function getCode($code, $cardId = null)
    {
        $params = array(
            'code' => $code,
            'card_id' => $cardId,
        );

        return new Bag($this->http->jsonPost(self::API_CODE_GET, $params));
    }
899244
public function consume(string $code, string $cardId = null)
    {
        $params = [
            'code' => $code,
        ];

        if (!is_null($cardId)) {
            $params['card_id'] = $cardId;
        }

        return $this->httpPostJson('card/code/consume', $params);
    }
326403
public function setReceptionCode($newCode, $userId)
    {
        $oldCode = $this->respondentTrack->getReceptionCode();
        
        if (! $newCode instanceof \Gems_Util_ReceptionCode) {
            $newCode = $this->util->getReceptionCode($newCode);
        }

        // Use the repesondent track function as that cascades the consent code
        $changed = $this->respondentTrack->setReceptionCode($newCode, $this->formData['gr2t_comment'], $userId);

        if ($this->unDelete) {
            $this->addMessage($this->_('Track restored.'));

            if (isset($this->formData['restore_tokens']) && $this->formData['restore_tokens']) {                
                $count = $this->respondentTrack->restoreTokens($oldCode, $newCode);
                
                $this->addMessage(sprintf($this->plural(
                        '%d token reception codes restored.',
                        '%d tokens reception codes restored.',
                        $count
                        ), $count));
            }
        } else {
            if ($newCode->isStopCode()) {
                $this->addMessage($this->_('Track stopped.'));
            } else {
                $this->addMessage($this->_('Track deleted.'));
            }
        }

        return $changed;
    }
630152
public function getByRegistrationToken($code)
    {
        $builder = $this->createQueryBuilder('u');

        return $builder
            ->where('u.registrationConfirmToken.id=:code')
            ->andWhere($builder->expr()->isNotNull('u.registrationConfirmToken.id'))
            ->setParameter('code', $code)
            ->setMaxResults(1)
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }
734632
public function renderLines(array $codes, $newLine = true, $eolLine = true)
    {
        $result = '';
        $count = count($codes);

        for ($index = 0; $index < $count; ++$index) {
            $result .= $this->renderLine($codes[$index], $newLine && $index !== $count - 1);
        }

        return $this->renderLine($result, $eolLine);
    }
545117
public function cardConsume($code, $cardId = null)
    {
        $result = $this->httpRaw(static::WECHAT_CARD_CONSUME_URL . 'access_token=' . $this->getAccessToken(), [
            'code' => $code,
            'card_id' => $cardId
        ]);
        if (isset($result['errmsg']) && $result['errmsg'] === 'ok') {
            return ['card_id' => $result['card']['card_id'], 'openid' => $result['openid']];
        }
        return false;
    }
1265519
public function createAddCardJsPackage($cardid = null, $data = array())
    {
        $cardList = array();
        if (is_array($cardid)) {
            foreach ($cardid as $id) {
                $cardList[] = array('cardId' => $id, 'cardExt' => json_encode($this->_cardSign($id, $data)));
            }
        } else {
            $cardList[] = array('cardId' => $cardid, 'cardExt' => json_encode($this->_cardSign($cardid, $data)));
        }
        return array('cardList' => $cardList);
    }
106518
public function getCard($cardID, $token)
    {
        $httpResponse = $this->httpClient->send(
            new GetHttpRequest(
                sprintf("%s/card/v5/%s", $this->serviceUrl, $cardID),
                null,
                ["Authorization" => sprintf("Virgil %s", $token)]
            )
        );

        if (!$httpResponse->getHttpStatusCode()
                          ->isSuccess()) {
            return $this->parseErrorResponse($httpResponse->getBody());
        }

        $rawSignedModel = RawSignedModel::RawSignedModelFromJson($httpResponse->getBody());

        return new ResponseModel($httpResponse->getHeaders(), $rawSignedModel);
    }
620167
public function postSignup($code = null)
    {
        if ($code === null) {
            throw new NotFoundHttpException();
        }

        $invite = Invite::where('code', '=', $code)->first();

        if (!$invite || $invite->is_claimed) {
            throw new BadRequestHttpException();
        }

        try {
            execute(new SignupUserCommand(
                Binput::get('username'),
                Binput::get('password'),
                Binput::get('email'),
                User::LEVEL_USER
            ));
        } catch (ValidationException $e) {
            return cachet_redirect('signup.invite', [$invite->code])
                ->withInput(Binput::except('password'))
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.signup.failure')))
                ->withErrors($e->getMessageBag());
        }

        execute(new ClaimInviteCommand($invite));

        return cachet_redirect('status-page')
            ->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.signup.success')));
    }