Updates the default card
@param string $cardId The cardId to update to the default card
@return $this
2549
public function updateDefaultCard($cardId)
    {
        // first lets update the default source for the stripe customer
        $customer = $this->asStripeCustomer();
        $customer->default_source = $cardId;
        $result = $customer->save();

        // now lets update the users default card
        $card = $this->getCard($cardId);

        $this->card_brand = $card->brand;
        $this->card_last_four = $card->last4;

        $this->save();

        return $this;
    }
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);
    }
294830
public function setRefId($refId)
    {
        if ($this->refIdAttribute == $this->guidAttribute) {
            return $this->setGUID($refId);
        }
        if ($this->refIdAttribute == $this->idAttribute) {
            return $this->setID($refId);
        }
        return $this->{$this->refIdAttribute} = $refId;
    }
1113221
public function setAppId($appId)
    {
        $element = new Element('meta');

        $element->attributes[ 'name' ] = 'fb:app_id';
        $element->attributes[ 'content' ] = $appId;

        parent::offsetSet('fb:app_id', $element);

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

        return $this->httpPostJson('card/membercard/activateuserform/set', $params);
    }
1284629
public function setContactId($contactId)
    {
        $this->set(self::MTC_ID, $contactId);

        if ($sessionId = $this->getSessionId()) {
            $this->set($sessionId, $contactId);
        }

        return $this;
    }
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);
    }
1300488
public function getCard($userId, $cardId)
    {
        $card = $this->client->get($this->getResourceEndpoint($userId) . '/' . (int)$cardId);

        return $card['Response'][0];
    }
104190
public function update(?string $id)
    {
        $url = self::$base_url.'/'.($id ?? $this->container_id).'/update';

        $request = json_encode($request = $this->hostConfig);

        return self::$curl->post($url, $request, self::$header);
    }
141695
public function setSessionId($sessionId)
    {
        $this->set(self::MAUTIC_SESSION_ID, $sessionId);
        $this->set(self::MTC_SID, $sessionId);

        return $this;
    }
187545
public function updateCardFromStripe()
    {
        $customer = $this->asStripeCustomer();
        $defaultCard = null;
        foreach ($customer->sources->data as $card) {
            if ($card->id === $customer->default_source) {
                $defaultCard = $card;
                break;
            }
        }
        if ($defaultCard) {
            $this->fillCardDetails($defaultCard)->save();
        } else {
            $this->card_brand = null;
            $this->card_last_four = null;
            $this->update(false);
        }

        return $this;
    }
1292931
public function update($cardId, $type, array $attributes = [])
    {
        $card = [];
        $card['card_id'] = $cardId;
        $card[strtolower($type)] = $attributes;

        return $this->httpPostJson('card/update', $card);
    }
161527
public function setId($id)
    {
        $this->getTabs()->each(function (TabInterface $tab) use ($id) {
            if ($tab instanceof FormInterface) {
                $tab->setId($id);
            }
        });

        return $this;
    }
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);
    }
894222
public function update(int $merchantId, array $info = [])
    {
        $params = [
            'info' => array_merge(['merchant_id' => $merchantId],
                Arr::only($info, [
                    'brand_name',
                    'logo_url',
                    'protocol',
                    'end_time',
                    'primary_category_id',
                    'secondary_category_id',
                    'agreement_media_id',
                    'operator_media_id',
                    'app_id',
                ])),
        ];

        return $this->httpPostJson('card/submerchant/update', $params);
    }
888539
public function setCustomerId($id)
    {
        if (!isset($this->data->customer)) {
            $this->data->customer = new stdClass();
        }
        $this->data->customer->id = $id;

        return $this;
    }
653140
protected function update()
    {
        $this->preUpdate();
        $this->data = $this->api->update($this->id, $this->data);
        $this->postUpdate();

        return $this;
    }