PDA

View Full Version : Authorize.net Error



seandon01
03-24-2005, 02:52 PM
Okay So I had a problem with my max1.7 store, it wouldnt work with authorize.net, so i hired a third party coder to trouble shoot my store.. they fixed it and got the module working.. Now i installed another oscmax 1.7 store and i have the same problem.. It just wont connect with authorize.net, i dont get it, i have the curl path set up correctly, ive been searching left and right on this form.. it wont work and i cant afford to use the third party coder to fix it.. Please help... thank You

michael_s
03-24-2005, 03:24 PM
There is no problem with the authorize net module. The module requires that cURL be compiled into PHP with SSL support. Check your server's specs to make sure it meets taht requirement.

seandon01
03-24-2005, 04:00 PM
Im on a shared server with mediatemple.com. How do i check to see if curl is compiled with php? EDIT:: i talked to the host and curl is compiled into php with ssl support.. but he notified me that php is in safe mode.. does that make any difference?

michael_s
03-24-2005, 09:26 PM
In /includes/modules/authorizenet_direct.php, have you correctly set your path to curl?

Find this code:


// Post order info data to Authorize.net, make sure you have curl installed
// Please edit the "Path to cURL" to reflect your path to cURL. Leave the -d and everything
// after it intact (i.e. /usr/local/bin/curl or c:/apache/htdocs/bin/curl)
exec("/usr/bin/curl -d \"$data\" https://secure.authorize.net/gateway/transact.dll", $response);

and follow the instructuions...

seandon01
03-25-2005, 01:24 PM
I have it set correctly. and it still isnt working.. Could it be server related?

michael_s
03-25-2005, 02:56 PM
When you say it is not working, are you getting any error messages? Have you looked in the error logs to see if they tell you anything?

You may want to try changing the curl call to:


exec("/usr/bin/curl -dk \"$data\" https://secure.authorize.net/gateway/transact.dll", $response);

See if that helps.

Also, if you have ssh access, from the server command line when you type which curl what is the output?

seandon01
03-25-2005, 03:04 PM
First off. Thanks for helping me out.. The error logs arent reporting anything.. And when i type which curl in ssh, it says which:command not found. and unfortunately the -dk didnt work.. Wow this is so frustrating... Thanks

michael_s
03-25-2005, 04:40 PM
Is the exec command disabled on your server? Is this a linux machine?

You may want to use the php curl commands instead of command line curl. Replace the above code I posted with this:



$defined_vars = get_defined_vars();
$_url = 'https://secure.authorize.net/gateway/transact.dll';

$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
curl_setopt($ch, CURLOPT_URL,$_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

$authorize = curl_exec ($ch);
curl_close ($ch);
$response = split(',', $authorize);
echo("Output: ".$response);

seandon01
03-25-2005, 05:24 PM
So i changed the code as you specifies above, and it replied
Parse error: parse error, unexpected T_STRING in /home/virtual/site137/fst/var/www/html/shop/includes/modules/authorizenet_direct.php on line 70
Also i dont know how to check if the exec command is disabled. yes it is linux. Thank you very much. I really appreciate you helpin me

michael_s
03-25-2005, 07:43 PM
Find this line (should be 65):


unset($response);

And replace all the code after it with:


// Post order info data to Authorize.net, make sure you have curl installed
// Please edit the "Path to cURL" to reflect your path to cURL. Leave the -d and everything
// after it intact (i.e. /usr/local/bin/curl or c:/apache/htdocs/bin/curl)
$defined_vars = get_defined_vars();
$_url = 'https://secure.authorize.net/gateway/transact.dll';

$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
curl_setopt($ch, CURLOPT_URL,$_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

$authorize = curl_exec ($ch);
curl_close ($ch);
$response = split(',', $authorize);
echo("Output: ".$response);

?>

It works for me without any parse errors, so I can only assume there is a mistake somewhere in how you pasted it into your file.

seandon01
03-28-2005, 11:45 AM
I dont get it.. I pasted it exactly as you sepcified. And still a parse error.. Could it be something else that is affecting it?

michael_s
03-29-2005, 07:05 AM
Paste your line 70 that is throwing the error...

seandon01
03-29-2005, 01:52 PM
Hey, so i transfered the site to a different server (on of our own) and it works perfectly.. so its some server issue

michael_s
03-29-2005, 02:09 PM
Glad you have it sorted out...

seandon01
03-29-2005, 02:57 PM
Thank You For All Your Help Man!! You ARE AWESOME!!!!