Example #1
0
 /**
  * CheckoutApi_ constructor for curl class
  * @param array $arguments configuration for setting the curl connection
  * @throws Exception
  */
 public function __construct(array $arguments = array())
 {
     if (!CheckoutApi_Utility_Utilities::checkExtension('curl')) {
         //throw new Exception("cURL extension has to be loaded to use CheckoutApi_Client_Adapter_Curl ");
         $this->exception("cURL extension has to be loaded to use CheckoutApi_Client_Adapter_Curl", debug_backtrace());
     }
     parent::__construct($arguments);
 }
 /**
  * CheckoutApi_ print out the error
  * @return string $errorToreturn a list of errors
  */
 public function debug()
 {
     $errorToreturn = '';
     if ($this->_debug && $this->hasError()) {
         $message = $this->getMessage();
         $trace = $this->getTrace();
         $critical = $this->getCritical();
         for ($i = 0, $count = sizeOf($message); $i < $count; $i++) {
             if ($critical[$i]) {
                 echo '<strong style="color:red">';
             } else {
                 continue;
             }
             CheckoutApi_Utility_Utilities::dump($message[$i] . '==> { ');
             foreach ($trace[$i] as $errorIndex => $errors) {
                 echo "<pre>";
                 echo $errorIndex . "=>  ";
                 print_r($errors);
                 echo "</pre>";
             }
             if ($critical[$i]) {
                 echo '</strong>';
             }
             CheckoutApi_Utility_Utilities::dump('} ');
         }
     }
     return $errorToreturn;
 }