Example #1
0
 /**
  * Get API key (with prefix if set)
  * @param string $apiKey name of apikey
  * @return string API key with the prefix
  */
 public function getApiKeyWithPrefix($apiKey)
 {
     $prefix = $this->config->getApiKeyPrefix($apiKey);
     $apiKey = $this->config->getApiKey($apiKey);
     if (!isset($apiKey)) {
         return null;
     }
     if (isset($prefix)) {
         $keyWithPrefix = $prefix . " " . $apiKey;
     } else {
         $keyWithPrefix = $apiKey;
     }
     return $keyWithPrefix;
 }
 /**
  * Constructor
  * 
  * Inits the appropriate endpoint and httpconnector objects 
  * Sets all of the Profiles class properties
  * 
  * @param \Beanstream\Configuration $config
  */
 function __construct(Configuration $config)
 {
     //init endpoint
     $this->_endpoint = new Endpoints($config->getPlatform(), $config->getApiVersion());
     //init http connector
     $this->_connector = new HttpConnector(base64_encode($config->getMerchantId() . ':' . $config->getApiKey()));
 }
 /**
  * Constructor
  * 
  * Inits the appropriate endpoint and httpconnector objects 
  * Sets all of the Payments class properties
  * 
  * @param \Beanstream\Configuration $config
  */
 function __construct(Configuration $config)
 {
     //init endpoint
     $this->_endpoint = new Endpoints($config->getPlatform(), $config->getApiVersion());
     //init http connector
     $this->_connector = new HttpConnector(base64_encode($config->getMerchantId() . ':' . $config->getApiKey()));
     //set merchant id from config (only needed for unreferenced return)
     $this->_merchantId = $config->getMerchantId();
 }