Quick Contact
Name: Comments:
Email:
Phone:

Support : Code Archive : Using CURL on Godaddy Hosting

Using CURL on GoDaddy Shared Hosting

Are you having problems setting up Authorize.net, Nochex, Cybersource, VeriSign, Paypal, TrustCommerce, 2Checkout, Google Checkout, or another payment gateway services on GoDaddy hosting? As a certified Authorize.net developer Zipline Interactive regularly sets up and troubleshoots online payment integrations for companies.  The most common problem we are asked to troubleshoot is how to get these payment integrations to work on GoDaddy hosting.  GoDaddy is a tremendously popular web host particularly amongst our U.S. clientele. They also have some uncommon practices which can make payment integration difficult or confusing.  The reasons for these differences are valid, however, the lack of documentation by GoDaddy has made this a particularly difficult task. The most common differences is the requirement to use a proxy when utilizing CURL functionality to post data to a remote server. If you are having problems setting up your Authorize.net or other payment gateway on GoDaddy hosting this is likely your problem.  If you have any questions or need assistance please feel free to contact us today.

Below we have included an example of an Authorize.net integration which uses a proxy to successfully post data using CURL on GoDaddy shared hosting. If you are using another payment gatway like: Nochex, Cybersource, VeriSign, Paypal, TrustCommerce, 2Checkout, Google Checkout your code may vary but the proxy URL will be the same.

<?PHP
    
    
//SET URLS
    
$curl_url "https://secure.authorize.net/gateway/transact.dll";
    
$referer_url "https://www.website.com/scripts/process.php";
    
$proxy_url "64.202.165.130:3128";
    
    
//INITIALIZE A NEW CURL CONNECTION
    
$ch curl_init(); 
    
curl_setopt($chCURLOPT_URL,$curl_url);

    
//ADD GODADDY SPECIFIC CODE : PROXY (http://proxy.shr.secureserver.net:3128)
    
curl_setopt($chCURLOPT_HTTPPROXYTUNNELtrue); 
    
curl_setopt($chCURLOPT_PROXYTYPECURLPROXY_HTTP); 
    
curl_setopt($chCURLOPT_PROXY,$proxy_url);
    
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE); 

    
//COMPOSE THE CURL REQUEST
    
curl_setopt($chCURLOPT_POST1); 
    
curl_setopt($chCURLOPT_REFERER,$referer_url); 
    
curl_setopt($chCURLOPT_POSTFIELDS$valuestopost); 
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
    
//RETURN CURL RESULTS
    
$curlresults curl_exec($ch); 
        
    
//CLOSE CURL CONNECTION
    
curl_close ($ch); 
    
?>

© 2005-2008 Zipline Interactive Inc. Spokane Washington (WA)

421. W. Riverside Suite 760 | Spokane WA 99201

Toll Free