_config = new Configuration(); $this->_config->setMerchantId($merchantId); $this->_config->setApiKey($apiKey); $this->_config->setPlatform($platform); $this->_config->setApiVersion($version); // if (strlen($subMerchantId) > 0) $this->_config->setSubMerchantId($subMerchantId); $this->_config->setSubMerchantId($subMerchantId); } /** * getConfig() function * * @return \Beanstream\Configuration this gateway's set config */ public function getConfig() { return $this->_config; } /** * payments() function * * Public facing function to return the configured payment API * All comms with the Payments API will go through this function * * @return \Beanstream\Payments this gateway's payment api object */ public function payments() { //check to see if we already have it created if (is_null($this->_paymentsAPI)) { //if we don't, create it $this->_paymentsAPI = new Payments($this->_config); } return $this->_paymentsAPI; } /** * profiles() function. * * Public facing function to return the configured profiles API * All comms with the Profiles API will go through this function * * @return \Beanstream\Profiles this gateway's profiles api object */ public function profiles() { //check to see if we already have it created if (is_null($this->_profilesAPI)) { //if we don't, create it $this->_profilesAPI = new Profiles($this->_config); } return $this->_profilesAPI; } /** * reporting() function * * Public facing function to return the configured reporting API * All comms with the Reporting API will go through this function * * @return \Beanstream\Reporting this gateway's reporting api object */ public function reporting() { //check to see if we already have it created if (is_null($this->_reportingAPI)) { //if we don't, create it $this->_reportingAPI = new Reporting($this->_config); } return $this->_reportingAPI; } }