Update customer's credit card.

@param  string  $token
@return void
967100
public function updateCard($token)
    {
        $customer = $this->asStripeCustomer();

        $token = StripeToken::retrieve($token, ['api_key' => $this->getStripeKey()]);

        // If the given token already has the card as their default source, we can just
        // bail out of the method now. We don't need to keep adding the same card to
        // a model's account every time we go through this particular method call.
        if ($token[$token->type]->id === $customer->default_source) {
            return;
        }

        $card = $customer->sources->create(['source' => $token]);

        $customer->default_source = $card->id;

        $customer->save();

        // Next we will get the default source for this model so we can update the last
        // four digits and the card brand on the record in the database. This allows
        // us to display the information on the front-end when updating the cards.
        $source = $customer->default_source
                    ? $customer->sources->retrieve($customer->default_source)
                    : null;

        $this->fillCardDetails($source);

        $this->save();
    }
329199
protected function updateSubscriptionsToPaymentMethod($token)
    {
        foreach ($this->subscriptions as $subscription) {
            if ($subscription->active()) {
                BraintreeSubscription::update($subscription->braintree_id, [
                    'paymentMethodToken' => $token,
                ]);
            }
        }
    }
1198479
private function _checkProhibitedTokens($token) {
		if ($this->_isActive('checkProhibitedTokens')) {
			if (in_array($token->getName(), $this->_prohibitedTokens)) {
				$msg = $this->_getMessage("PROHIBITED_TOKEN", $token->getName());
				$this->_writeError('checkProhibitedTokens', $msg);
			}
		}
	}
109622
private function addCreditcard(CreditCard $creditcard)
    {
        if (null === $creditcard->token) {
            # No token available.
            $this->post['card']['number'] = $creditcard->number;
            $this->post['card']['expiry_month'] = $creditcard->month;
            $this->post['card']['expiry_year'] = $creditcard->year;
            $this->post['card']['cvc'] = $creditcard->verification_value;
            $this->post['card']['name'] = $creditcard->name();

            return;
        }

        if (strpos($creditcard->token, 'card_') === 0) {
            return $this->post['card_token'] = $creditcard->token;
        }

        if (strpos($creditcard->token, 'cus_') === 0) {
            return $this->post['customer_token'] = $creditcard->token;
        }
    }
1016303
public function setToken($token = null)
    {
        if ( ! $token and $this->session->has('googleapi_token') )
        {
            $token = $this->session->get('googleapi_token');
        }

        return $this->client->setAccessToken($token);
    }
1295380
public function updateCard( CustomerVault\Card $card )
    {
        $card->setRequiredFields(array(
            'profileID',
            'id'
        ));
        $card->checkRequiredFields();
        $card->setRequiredFields(array());
        $card->setOptionalFields(array(
            'cardExpiry',
            'nickName',
            'merchantRefNum',
            'holderName',
            'billingAddressId',
            'defaultCardIndicator',
        ));

        $request = new Request(array(
            'method' => Request::PUT,
            'uri' => $this->prepareURI("/profiles/" . $card->profileID . "/cards/" . $card->id),
            'body' => $card
        ));
        $response = $this->client->processRequest($request);
        $response['profileID'] = $card->profileID;

        return new CustomerVault\Card($response);
    }
1044159
public function updateCustomer($customer_id, CreditCard $creditcard = null, $options = array())
    {
        $this->post = array();

        $options = new Options($options);

        $this->addCustomerData($options);
        $this->addAddress($options);
        $address = $this->post['address'];
        unset($this->post['address']);
        $this->post = array_merge($this->post, $address);

        if (null !== $creditcard) {
            $this->addRecurringCreditcard($creditcard);
        }

        $customer_id = urlencode(trim($customer_id));

        return $this->commit("customers/{$customer_id}", RequestInterface::METHOD_PUT);
    }
267084
public function addToken(Token $token)
    {
        $this->load();
        parent::addToken($token);
        $this->save();
    }
981023
public function setToken($token)
    {
        $this->token = $token instanceof Token ? $token : new Token($token);

        return $this;
    }
1308114
protected function clearToken($token)
    {
        $token = $this->tokenize($token);
        $this->checkToken($token);
        $this->tokens[$token] = array();
    }
1123262
public function setToken($token) {
    // check passed data
    if(!is_null($token) && !is_array($token)) {
      // bad data passed
      throw new LinkedInException('LinkedIn->setToken(): bad data passed, $token_access should be in array format.');
    }
    
    // set token
    $this->token = $token;
	}
789998
public function update(Customer &$customer)
    {
        $data = $customer->exportData();
        $endpoint = '/admin/customers/'.$customer->id.'.json';
        $response = $this->request(
            $endpoint, 'PUT', array(
            'customer' => $data
            )
        );
        $customer->setData($response['customer']);
    }
1202003
public function setToken($token)
    {
        $this->token = $token;
        $this->username = '';
        $this->password = '';
        $this->accessToken = '';
        return $this;
    }
562642
public function setAccessToken($token)
    {
        if (!$this->oauthResponse instanceof InstagramOAuth) {
            $this->oauthResponse = new InstagramOAuth(json_decode(json_encode(['access_token' => $token])));
        }
    }
132183
public function setDefaultAccessToken($token)
    {
        if (is_string($token)) {
            $this->accessToken = new AccessToken(json_decode($token, true));
        } elseif ($token instanceof AccessToken) {
            $this->accessToken = $token;
        } else {
            throw new \Exception("Incorrect access token");
        }
        if ($this->accessToken->hasExpired()) {
            $this->refreshToken();
        }
        return $this->accessToken;
    }
1230536
private function authenticateUser($token)
    {
        $this->imgur->setAccessToken($token);
        // Refresh the token if neccessary
        if($this->imgur->checkAccessTokenExpired())
        {
            $this->imgur->refreshToken();
        }
    }
53950
public function updateRememberToken(UserContract $user, $token)
    {
        $this->conn->table($this->table)
                ->where($user->getAuthIdentifierName(), $user->getAuthIdentifier())
                ->update([$user->getRememberTokenName() => $token]);
    }