Example #1
0
 public function adjust($options = array())
 {
     if (isset($options['amount']) && isset($options['TransactionId'])) {
         $amount = number_format($options['amount'], 2, '.', '');
         try {
             $xml = VelocityXmlCreator::adjustXML($options['TransactionId'], $amount);
             // got adjust xml object.
             $xml->formatOutput = TRUE;
             $body = $xml->saveXML();
             //echo '<xmp>'.$body.'</xmp>'; die;
             list($error, $response) = $this->connection->put($this->path(self::$workflowid, $options['TransactionId'], self::$Txn_method[4]), array('sessiontoken' => $this->sessionToken, 'xml' => $body, 'method' => self::$Txn_method[4]));
             return $this->handleResponse($error, $response);
             //return $response;
         } catch (Exception $e) {
             throw new Exception($e->getMessage());
         }
     } else {
         throw new Exception(VelocityMessage::$descriptions['erradjustsesswfltransid']);
     }
 }