Example #1
0
 /**
  * undocumented function
  *
  * @param string $data 
  * @return void
  * @author Adam Venturella
  */
 public static function responseWithData($data)
 {
     print_r($data);
     $response = new RenegadeResponse();
     $response->setData($data);
     return $response;
 }
 /**
  * undocumented function
  *
  * @param RenegadeCommand $command 
  * @return RenegadeResponse
  * @author Adam Venturella
  */
 public function execute(RenegadeCommand $command, $key, $secret)
 {
     $auth = RenegadeAuthorization::authorizationForCommandWithKeyAndSecret($command, $key, $secret);
     $command->setAuthorization($auth);
     //echo $command->request();exit;
     $data = $this->connect($command->request());
     $response = RenegadeResponse::responseWithData($data);
     if ($response->error) {
         throw new Exception('RenegadeCommand(' . $command . ') Failed with error ' . $response->error['error'] . ': ' . $response->error['reason']);
     } else {
         return $response;
     }
 }