/**
  * Sets the WSDL endpoint based on $portType and on the environment
  * set in the user's profile.
  *
  * @param string $portType  The portType the current operation is part of.
  * @param string $version   The WSDL version being used.
  *
  * @return boolean | PayPal_Error  An error if mapping can't be done, else true.
  */
 function setEndpoint($portType, $version)
 {
     $version = (double) $version;
     foreach ($this->_endpointMap as $range) {
         if ($version >= $range['min'] && $version <= $range['max'] && isset($range['environments'][$this->_profile->getEnvironment()][$portType])) {
             $this->_endpoint = $range['environments'][$this->_profile->getEnvironment()][$portType];
             return true;
         }
     }
     return Services_PayPal::raiseError("Invalid version/environment/portType combination.");
 }
Esempio n. 2
0
 /**
  * Sets the WSDL endpoint based on $portType and on the environment
  * set in the user's profile.
  *
  * @param string $portType  The portType the current operation is part of.
  * @param string $version   The WSDL version being used.
  *
  * @return boolean | PayPal_Error  An error if mapping can't be done, else true.
  */
 function setEndpoint($portType, $version)
 {
     $version = (double) $version;
     foreach ($this->_endpointMap as $range) {
         if ($version >= $range['min'] && $version <= $range['max'] && isset($range['environments'][$this->_profile->getEnvironment()][$portType])) {
             // Check 3-token auth
             $signature = $this->_profile->getSignature();
             if (isset($signature)) {
                 // TBD:  Is this legit?
                 $three_token_port = $portType . '-threetoken';
                 $this->_endpoint = $range['environments'][$this->_profile->getEnvironment()][$three_token_port];
             } else {
                 $this->_endpoint = $range['environments'][$this->_profile->getEnvironment()][$portType];
             }
             $this->getLogger();
             $this->_logger->log('DEBUG setEndpoint: ' . $this->_endpoint, PEAR_LOG_DEBUG);
             return true;
         }
     }
     return PayPal::raiseError("Invalid version/environment/portType combination.");
 }