/**
  * Updates Ebay API Token and stores it
  *
  * Returns true is sucessful, false otherwise
  *
  * @return boolean
  */
 public static function updateAPIToken()
 {
     $request = new EbayRequest();
     if ($token = $request->fetchToken(Configuration::get('EBAY_API_USERNAME'), Configuration::get('EBAY_API_SESSION'))) {
         Configuration::updateValue('EBAY_API_TOKEN', $token, false, 0, 0);
         Configuration::updateValue('EBAY_TOKEN_REGENERATE', false);
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 /**
  * Updates Ebay API Token and stores it
  *
  * Returns true is sucessful, false otherwise
  *
  * @return boolean
  */
 public static function updateAPIToken()
 {
     $profile_data = explode('_', Configuration::get('EBAY_CURRENT_PROFILE'));
     $request = new EbayRequest($profile_data[0]);
     $ebay_profile = EbayProfile::getCurrent(false);
     //		if ($token = $request->fetchToken(Configuration::get('EBAY_API_USERNAME', null, 0, 0), Configuration::get('EBAY_API_SESSION', null, 0, 0)))
     if ($token = $request->fetchToken($ebay_profile->ebay_user_identifier, Configuration::get('EBAY_API_SESSION', null, 0, 0))) {
         $ebay_profile->setToken($token);
         //Configuration::updateValue('EBAY_API_TOKEN', $token, false, 0, 0);
         Configuration::updateValue('EBAY_TOKEN_REGENERATE', false, false, 0, 0);
         return true;
     }
     return false;
 }