コード例 #1
0
 /**
  *
  * Constructor for SofortLib_TransactionData
  * @param string $configKey
  */
 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);
     return $this;
 }
コード例 #2
0
 /**
  * 
  * Constructor for SofortLib_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');
 }
コード例 #3
0
 public function getRefundError($i = 0)
 {
     return parent::getError('all', $this->_response[$i]);
 }
コード例 #4
0
 /**
  * Get the error occurred
  * (non-PHPdoc)
  * @see SofortLib::getError()
  */
 public function getError($paymentMethod = 'all', $message = '')
 {
     return parent::getError($paymentMethod, $message);
 }
コード例 #5
0
 /**
  * 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);
             }
         }
     }
 }
コード例 #6
0
 /**
  * Constructor for SofortLib_Notification
  */
 public function __construct()
 {
     parent::__construct('', '', '');
 }
コード例 #7
0
 function getStatusArray()
 {
     $ret = array();
     foreach ($this->response as $transaction) {
         if ($transaction['status'] == 'ok') {
             $ret[$transaction['transaction']] = 'ok';
         } else {
             $ret[$transaction['transaction']] = parent::getError($transaction);
         }
     }
     return $ret;
 }