/** * 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('sofortApiUrl') != '' ? getenv('sofortApiUrl') : 'https://api.sofort.com/api/xml'; parent::__construct($userId, $apiKey, $apiUrl); $this->_parameters['project_id'] = $projectId; }
/** * Constructor for SofortLibIDealBanks * * @param string $configKey * @param string $apiUrl (optional) * @return \SofortLibIdealBanks */ public function __construct($configKey, $apiUrl = '') { $this->_rootTag = 'ideal'; if ($apiUrl == '') { $apiUrl = getenv('idealApiUrl') != '' ? getenv('idealApiUrl') . '/banks' : self::IDEAL_BANKS_URL; } parent::__construct($configKey, $apiUrl); }
/** * * Getter for refund's errors * @param int $i */ public function getRefundError($i = 0) { return parent::getError('all', $this->_response[$i]); }
/** * Get the error occurred * (non-PHPdoc) * @see SofortLib::getError() */ public function getError($paymentMethod = 'all', $message = '') { return parent::getError($paymentMethod, $message); }
/** * Handle errors if occurred * (non-PHPdoc) * @see SofortLib::_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 SofortLibNotification */ public function __construct() { parent::__construct('', '', ''); }
/** * Sets the root tag and calls the parent method * * @see SofortLibAbstract::sendRequest() */ public function sendRequest() { $this->_rootTag = $this->_root . '_request'; parent::sendRequest(); }