删除指定卡券

@param string $cardId
@return false|Http
9831
public function deleteCard($cardId)
    {
        return $this->auth(function () use ($cardId) {
            $data = json_encode(['card_id' => $cardId], JSON_UNESCAPED_UNICODE);
            $result = $this->http->postJson($this->baseUrl . 'card/delete?access_token=' . $this->accessToken, $data);

            return $result;
        });
    }
700361
public function check(string $cardId, array $codes)
    {
        $params = [
            'card_id' => $cardId,
            'code' => $codes,
        ];

        return $this->httpPostJson('card/code/checkcode', $params);
    }
300531
public function updateCardCode($cardId, $code, $newCode)
    {
        $data = json_encode([
            'code' => (string) $code,
            'card_id' => (string) $cardId,
            'new_code' => (string) $newCode,
        ], JSON_UNESCAPED_UNICODE);

        return $this->auth(function () use ($data) {
            $result = $this->http->postJson(
                $this->baseUrl . 'card/code/update?access_token=' . $this->accessToken,
                $data
            );

            return $result;
        });
    }
402573
public function forceUnbind(string $openid, string $deviceId)
    {
        $params = [
            'device_id' => $deviceId,
            'openid' => $openid,
        ];

        return $this->httpPostJson('device/compel_unbind', $params);
    }
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);
    }
1186528
public function setPayCell($cardId, $isOpen = true)
    {
        $params = [
            'card_id' => $cardId,
            'is_open' => $isOpen,
        ];

        return $this->httpPostJson('card/paycell/set', $params);
    }
599081
private function verifyAndConfirm($transactionId = '')
    {
        if ($this->sandbox) {
            $this->endpoint = $this->sandbox_endpoint;
        }

        // 验证 DOC 3.3
        $url = $this->endpoint . '/TradeQuery?AuthCode=' . $this->auth_code;
        $response = $this->xml2array($this->curl_request($url));
        $output = explode('|', $response['0']);
        if ($output['0'] != 1) {
            throw new Exception($output['1']);
        }

        // 确认交易 DOC 3.4
        // TODO :: 为避免不必要麻烦 所有 CPCustId 均使用 transactionId代替
        $url = $this->endpoint . '/PaymentConfirm?CPCustId=' . $transactionId . '&AuthCode=' . $this->auth_code;
        $response = $this->xml2array($this->curl_request($url));
        $output = explode('|', $response['0']);
        if ($output['0'] != 1) {
            throw new Exception($output['1']);
        }

        return true;
    }
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;
    }
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;
    }
1207520
public function cardDelete($card_id)
    {
        if (empty($card_id)) {
            $this->setError('缺少错误');

            return false;
        }

        $queryStr            = [];
        $queryStr['card_id'] = $card_id;

        $this->apitype = 'card';
        $this->module  = 'delete';
        $res           = $this->_post('', $queryStr);

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

        return $this->httpPostJson('card/membercard/activateuserform/set', $params);
    }
211113
public function attachExtension($cardId, array $extension = array())
    {
        $timestamp = time();

        $ext = array(
            'code' => Arr::get($extension, 'code'),
            'openid' => Arr::get($extension, 'openid', Arr::get($extension, 'open_id')),
            'timestamp' => $timestamp,
            'outer_id' => Arr::get($extension, 'outer_id'),
            'balance' => Arr::get($extension, 'balance'),
        );

        $ext['signature'] = $this->getSignature(
            $this->getTicket(),
            $timestamp,
            $cardId,
            $ext['code'],
            $ext['openid'],
            $ext['balance']
        );

        return array(
            'cardId' => $cardId,
            'cardExt' => JSON::encode($ext),
        );
    }
1020741
public function delCard($card_id) {
        $data = array(
            'card_id' => $card_id,
        );
        if (!$this->access_token && !$this->checkAuth()) return false;
        $result = $this->http_post(self::API_BASE_URL_PREFIX . self::CARD_DELETE . 'access_token=' . $this->access_token, self::json_encode($data));
        if ($result) {
            $json = json_decode($result, true);
            if (!$json || !empty($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg  = $json['errmsg'];
                return false;
            }
            return true;
        }
        return false;
    }
79853
public function get($agentid)
    {
        $response = $this->http->get(self::API_GET . '?agentid=' . $agentid);

        return $response;
    }
675821
public function deleteUser($userId)
    {
        $result = $this->httpGet(self::WECHAT_USER_DELETE_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'userid' => $userId
        ]);
        return isset($result['errcode']) && !$result['errcode'];
    }
1337844
public function getid($openid)
    {
        if (!$openid) {
            $this->setError('参数错误,缺少Openid');

            return false;
        }

        $queryStr = ['openid' => $openid];

        $res = $this->_post('getid', $queryStr);

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

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