http://help.godaddy.com/article/289
yes, you're right. note the changes i made below... connects for me now...
Code:function PostTransaction ($transaction) { // This function accepts one variable as an array. // That array should contain all of the variables // required to connect to and authorized payments in // the payment gateway. // // You can create as many "object arrays" as you like // and when ready send them through the PostTransaction() // function to perform the appropriate action. //--< GATEWAY/ISP OPTIONS >------------------ $URL="https://transactions.innovativegateway.com/servlet/com.gateway.aai.Aai"; $user_agent = "Mozilla/4.0"; $proxy = ""; // If you use a proxy server to connect // your server to the Internet then put // in its address here. // Create the POST form to send to the gateway using // the incoming array. $data = ""; foreach ($transaction as $name => $value) { $data .= "&" . $name . "=" . urlencode($value); } $data = substr($data,1); // Create the connection through the cURL extension $ch = curl_init(); // if ($proxy != "") // curl_setopt ($ch, CURLOPT_PROXY, $proxy); echo "URL = $URL <br>n"; curl_setopt ($ch, CURLOPT_VERBOSE, 1); curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE); curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt ($ch, CURLOPT_PROXY,"http://proxy.shr.secureserver.net:3128"); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt ($ch, CURLOPT_URL, $URL); curl_setopt ($ch, CURLOPT_TIMEOUT, 120); curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, $data); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); // curl_setopt ($ch, CURLOPT_TIMEOUT, 120); $result = curl_exec ($ch); echo "<hr><br>n"; echo 'Errors: ' . curl_errno($ch) . ' ' . curl_error($ch) . '<br><br>'; echo "<hr><br>n"; curl_close ($ch); // print "result = $result"; echo "<hr><br>n"; // Now we've got the results back in a big string. // Parse the string into an array to return $rArr = explode("|",$result); $returnArr=""; for($i=0;$i<count($rArr);$i++) { $tmp2 = explode("=", $rArr[$i]); // YES, we put all returned field names in lowercase $tmp2[0] = strtolower($tmp2[0]); // YES, we strip out HTML tags. $returnArr[$tmp2[0]] = strip_tags($tmp2[1]); } // Return the array. return $returnArr; } ?>


Reply With Quote
