--- /home/ben/public_html/cvs/moneris/eSELECTplus_PHP_API2/mpgClasses.php	2006-06-16 13:05:32.000000000 -0400
+++ mpgClasses.php	2006-11-07 18:17:24.000000000 -0500
@@ -1,4 +1,3 @@
-
 <?php
 
 #################### mpgGlobals ###########################################
@@ -47,7 +46,8 @@
   $this->mpgRequest=$mpgRequestOBJ;
 
   $dataToSend=$this->toXML();
-  //print ($dataToSend);
+
+	dbg($dataToSend);
 
   //do post
 
@@ -59,19 +59,30 @@
        $gArray[MONERIS_PORT].
        $gArray[MONERIS_FILE];
 
-  $ch = curl_init();
-  curl_setopt($ch, CURLOPT_URL,$url);
-  curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
-  curl_setopt ($ch, CURLOPT_HEADER, 0);
-  curl_setopt($ch, CURLOPT_POST, 1);
-  curl_setopt($ch, CURLOPT_POSTFIELDS,$dataToSend);
-  curl_setopt($ch,CURLOPT_TIMEOUT,$gArray[CLIENT_TIMEOUT]);
-  curl_setopt($ch,CURLOPT_USERAGENT,$gArray[API_VERSION]);
-  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
-
-  $response=curl_exec ($ch);
-
-  curl_close ($ch);
+/*
+	$ch = curl_init();
+	curl_setopt($ch, CURLOPT_URL,$url);
+	curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
+	curl_setopt ($ch, CURLOPT_HEADER, 0);
+	curl_setopt($ch, CURLOPT_POST, 1);
+	curl_setopt($ch, CURLOPT_POSTFIELDS,$dataToSend);
+	curl_setopt($ch,CURLOPT_TIMEOUT,$gArray[CLIENT_TIMEOUT]);
+	curl_setopt($ch,CURLOPT_USERAGENT,$gArray[API_VERSION]);
+	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+
+
+   $response=curl_exec ($ch);
+   
+	curl_close($ch);
+/**/
+/**/
+	$ch =& new Curl($url);
+	$ch->addHeader("User-Agent: " . $gArray[API_VERSION]);
+	$ch->addField("", $dataToSend, 0);
+	$response=$ch->toString(0);
+	//echo $response;
+  	$ch->close();
+/**/
 
   if(!$response)
    {
@@ -505,7 +516,8 @@
 
     $txn=$txnObj->getTransaction();	//call to a non-member function
 
-    $txnType=array_shift($txn);
+    //$txnType=array_shift($txn);
+    $txnType=$txn["type"];
     $tmpTxnTypes=$this->txnTypes;
     $txnTypeArray=$tmpTxnTypes[$txnType];
     $txnTypeArrayLen=count($txnTypeArray); //length of a specific txn type
@@ -841,7 +853,3 @@
 
 }//end class
 
-
-?>
-
-
