/**
  * create a new payment object
  * @param string $apikey your API key
  * @param int $projectId your project id
  */
 public function __construct($configKey = '')
 {
     list($userId, $projectId, $apiKey) = explode(':', $configKey);
     $apiUrl = getenv('ubrirApiUrl') != '' ? getenv('ubrirApiUrl') : 'https://api.ubrir.com/api/xml';
     parent::__construct($userId, $apiKey, $apiUrl);
     $this->_parameters['project_id'] = $projectId;
 }
 /**
  * 
  * Constructor for ubrirLib_iDeal_Banks
  * @param string $configKey
  * @param strign $apiUrl
  */
 public function __construct($configKey, $apiUrl = '')
 {
     list($userId, $projectId, $apiKey) = explode(':', $configKey);
     parent::__construct($userId, $apiKey, $apiUrl . '/banks');
 }
 /**
  * 
  * Getter for refund's errors
  * @param int $i
  */
 public function getRefundError($i = 0)
 {
     return parent::getError('all', $this->_response[$i]);
 }
 /**
  * Handle errors if occurred
  * (non-PHPdoc)
  * @see ubrirLib::_handleErrors()
  */
 protected function _handleErrors()
 {
     if ($this->_apiVersion == 1) {
         return parent::_handleErrors();
     }
     if (!isset($this->_response['invoices']['invoice'][0])) {
         $tmp = $this->_response['invoices']['invoice'];
         unset($this->_response['invoices']['invoice']);
         $this->_response['invoices']['invoice'][0] = $tmp;
     }
     foreach ($this->_response['invoices']['invoice'] as $response) {
         //handle errors
         if (isset($response['errors']['error'])) {
             if (!isset($response['errors']['error'][0])) {
                 $tmp = $response['errors']['error'];
                 unset($response['errors']['error']);
                 $response['errors']['error'][0] = $tmp;
             }
             foreach ($response['errors']['error'] as $error) {
                 $this->errors['sr'][] = $this->_getErrorBlock($error);
             }
         }
         //handle warnings
         if (isset($response['warnings']['warning'])) {
             if (!isset($response['warnings']['warning'][0])) {
                 $tmp = $response['warnings']['warning'];
                 unset($response['warnings']['warning']);
                 $response['warnings']['warning'][0] = $tmp;
             }
             foreach ($response['warnings']['warning'] as $error) {
                 $this->warnings['sr'][] = $this->_getErrorBlock($error);
             }
         }
     }
 }
 /**
  * Constructor for ubrirLib_Notification
  */
 public function __construct()
 {
     parent::__construct('', '', '');
 }
 /**
  * Get the error occurred
  * (non-PHPdoc)
  * @see ubrirLib::getError()
  */
 public function getError($paymentMethod = 'all', $message = '')
 {
     return parent::getError($paymentMethod, $message);
 }