Ejemplo n.º 1
0
 /**
  * Loads the environment names from the endpoint map.
  *
  * @return mixed True on success or a PayPal error object on failure
  */
 function loadEnvironments()
 {
     $version = Services_PayPal::getWSDLVersion();
     $endpoints = Services_PayPal::getEndpoints();
     if (Services_PayPal::isError($endpoints)) {
         return $endpoints;
     }
     foreach ($endpoints as $range) {
         if ($version >= $range['min'] && $version <= $range['max']) {
             foreach (array_keys($range['environments']) as $environment) {
                 $this->_validEnvironments[] = strtolower($environment);
             }
             return true;
         }
     }
     return Services_PayPal::raiseError("Could not find any endpoint mappings for WSDL version '{$version}'");
 }