Deleting a payment token
@param string $token
@return null|OpenPayU_Result
@throws OpenPayU_Exception
@throws OpenPayU_Exception_Configuration
510440
public static function delete($token)
    {

        try {
            $authType = self::getAuth();
        } catch (OpenPayU_Exception $e) {
            throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
        }

        if (!$authType instanceof AuthType_Oauth) {
            throw new OpenPayU_Exception_Configuration('Delete token works only with OAuth');
        }

        if (OpenPayU_Configuration::getOauthGrantType() !== OauthGrantType::TRUSTED_MERCHANT) {
            throw new OpenPayU_Exception_Configuration('Token delete request is available only for trusted_merchant');
        }

        $pathUrl = OpenPayU_Configuration::getServiceUrl() . self::TOKENS_SERVICE . '/' . $token;

        $response = self::verifyResponse(OpenPayU_Http::doDelete($pathUrl, $authType));

        return $response;
    }
194686
public static function check( $token )
    {
        $token_name = 'token';

        if(Session::exists($token_name) && $token == Session::exists($token_name) )
        {
            Session::delete($token_name);
            return true;
        }
        return false;
    }
845831
public function processRequestToken($token) {
        // Setup the params
        $params = [
            'client_id'     => $this->clientID,
            'client_secret' => $this->secret,
            'code'          => $token,
            'grant_type'    => 'authorization_code',
            'redirect_uri'  => $this->redirectURI
        ];

        // Parse the cURL result
        return CURL::post($this->url, $params);
    }
564287
public function setPasswordResetToken($token = '')
    {
        if (empty($this->passwordResetTokenAttribute) || !is_string($this->passwordResetTokenAttribute)) {
            return null;
        }
        return $this->{$this->passwordResetTokenAttribute} = $token;
    }
1281081
protected function endProfile($token)
    {
        if (isset($this->profileTokens[$token])) {
            $time = microtime(true) - $this->profileTokens[$token];

            unset($this->profileTokens[$token]);
        }
        else {
            $time = 0;
        }

        $this->log(" done (time: " . sprintf('%.3f', $time) . "s)\n");
    }
569765
protected function _decode($token)
    {
        $config = $this->_config;
        try {
            $payload = JWT::decode(
                $token,
                $config['key'] ?: Security::getSalt(),
                $config['allowedAlgs']
            );

            return $payload;
        } catch (Exception $e) {
            if (Configure::read('debug')) {
                throw $e;
            }
            $this->_error = $e;
        }
    }
887376
public static function verify($token)
  {
    $userToken = Password::where('token', $token)->first();

    if ($userToken == null) {
      return false;
    }

    if ($userToken->created_at->diffInMinutes() <= config('app.reset_token.expire')) {
      if (Session::has('token')) {
        if (Session::key('token') == $userToken->token) {
          return true;
        }
        else {
          Session::delete('token');
          return false;
        }
      }
      else {
        return false;
      }
    }

    $userToken->delete();
    return false;
  }
146754
public function find($token)
    {
        $this->_validateId($token);
        try {
            $path = $this->_config->merchantPath() . '/payment_methods/paypal_account/' . $token;
            $response = $this->_http->get($path);
            return PayPalAccount::factory($response['paypalAccount']);
        } catch (Exception\NotFound $e) {
            throw new Exception\NotFound(
                'paypal account with token ' . $token . ' not found'
            );
        }

    }
1070902
public function resetPassword($token)
  {
    if (isset($_SESSION['reset']) &&  $_SESSION['reset']['token'] == $token) {
      if (isset($_POST['resetPassword'])) {
        if ($_POST['password'] == '') {
          $this->errors[] = 'Input new password!';
        }
        if ($_POST['password'] != $_POST['password2']) {
          $this->errors[] = 'The passwords you entered do not match!';
        }
        if (strlen($_POST['password']) < 8) {
          $this->errors[] = 'The password must contain at least 8 characters!';
        }
        if (empty($this->errors)) {
          $changeData = R::findOne('users', 'email = ?', array($_SESSION['reset']['email']));
          $changeData->password = password_hash($_POST['password'], PASSWORD_DEFAULT);

          if (R::store($changeData)) {
            $loadAuthSession = R::findAll('authorization', 'user_id = ?', array($changeData['id']));

            foreach ($loadAuthSession as $load)
            {
              R::trash('authorization', $load['id']);
            }

            mail($_POST['email'], 'Reset Password', "Your password will be restored", 'BulveyzTeam');

            unset($_SESSION['reset']);
            redirect('/login');
          } else {
            exit('Error DataChange');
          }
        } else {
          echo "<div class='alert alert-danger' role='alert'>" . array_shift($this->errors) . "</div>";
        }
      }
    } else {
      exit('404');
    }
  }
383656
protected function _get($token = null)
    {
        $token = $this->_token($token);
        $entity = $this->_verify($token);

        if ($this->_save($entity)) {
            return $this->_success();
        }

        $this->_error();
    }
1358734
protected function store_redis_cache_del($token) {
		if (!$this->redis)
			return;
		$key = sprintf('%s:%s', $this->token_name, $token);
		$this->redis->del($key);
		$this->logger->debug(sprintf(
			"Zapmin: session removed from cache: '%s'.", $token));
	}
848345
public function forget(string $token): void
    {
        $this->cache->forget($this->getCacheKey($token));
    }
456618
protected function getValidPasswordReset($token)
    {
        $passwordResets = $this->passwordResetData->listEntries(['token' => $token]);
        if (count($passwordResets) !== 1) {
            return null;
        }
        $passwordReset = $passwordResets[0];

        $createdAt = $passwordReset->get('created_at');
        if (strtotime($createdAt.' UTC') < time() - 2 * 24 * 60 * 60 || $passwordReset->get('reset')) {
            return null;
        }

        return $passwordReset;
    }
619674
public function setToken($token)
    {
        $token = trim($token);

        $this->isChanged('token', $token);

        $this->token = $token;

        return $this;
    }
545042
public function deleteUrls(
        $uuid,
        $token = null
    ) {
        $headers = [];

        if (!empty($token)) {
            $headers['Authorization'] = $token;
        }

        $response = $this->client->delete($uuid, [
            'headers' => $headers,
        ]);

        $this->log->debug("Gemini DELETE response", [
            'uuid' => $uuid,
            'response' => $response,
        ]);

        return true;
    }
1360333
public function checkToken($token, $once = true)
    {
        $check = $this->token() === $token;

        if ($once) {
            $this->delete('__token');
        }

        return $check;
    }
3031
public function setToken($token = null)
    {
        if (isset($token)) {
            return $this->token = $token;
        }

        return $this->token = gplcart_string_encode(crypt(session_id(), $this->config->getKey()));
    }