cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

goddady.com, authorize.net and php curl setup options

From: Boris Glants <bglants_at_comcast.net>
Date: Tue, 23 Aug 2005 21:28:55 -0700

Hello and thank you in advance for your help.
 
I am developing a shopping cart using authorize.net payment gateway for a
site that is on shared Linux hosting on goddady.com.
 
I downloaded sample code from authorize.net however it doesn't work on the
godaddy.com server. The same code runs fine on a server hosted at
dreamhost.com. I narrowed it down and it is the curl part that is causing
the problem. I made a sample test script.
 
<?php
 
$ch = curl_init("https://certification.authorize.net/gateway/transact.dll
<BLOCKED::https://certification.authorize.net/gateway/transact.dll> ");
 
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
 
$resp = curl_exec($ch);
curl_close($ch);
 
echo "<b>02: Get post results:</b><br>";
echo $resp;
echo "<br>";
?>
 
Given normal function the response will be:
 
<b>02: Get post results:</b><br><HTML><BODY><H3>The following errors have
occurred.</H3>(13) The merchant login ID or password is invalid or the
account is inactive.<BR></BODY></HTML><br>
 
On the go daddy server the script hangs for a couple of minutes as if it
can't get in touch with the authorize.net website. Then it finally outputs:
 
<b>02: Get post results:</b><br><br>
 
 
I don't have ssl from the domain I am running the script from, but I didn't
think that would be a problem given that I set curl_setopt($ch,
CURLOPT_SSL_VERIFYPEER, FALSE);
 
I ran some more tests and if I change the url of this simple script to say
http://www.google.com <BLOCKED::http://www.google.com> then it works
without any problems. This makes me think that I am missing some kind of
curl options that authorize.net requires.
 
Please let me know if anyone has any ideas, workaround suggestions, or
encountered similar problems.
 
Thanks again,
 
Boris Glants
www.sibylconsulting.com <BLOCKED::http://www.sibylconsulting.com/>
 
Received on 2005-08-24