Solved

godaddy.com host to authorize.net

Posted on 2008-06-17
28
1,227 Views
Last Modified: 2013-12-20
I can't connect to authorize.net in my shared godaddy host account.  I was told by authorize.net that they are not receiving anything on the host side.  when I run the cf_aim.cfm script that authorize.net supplies (http://developer.authorize.net/samplecode/), I get a "connection error".  I just spoke at length with godaddy tech support and they said I need a web.config file on the root of my file server and that I need to point to a proxy server which is in the config file.  I have no idea what they mean.  what they supplied me for the web.config was:

<system.net>
<defaultProxy>
<proxy usesystemdefault="False" proxyaddress="http://proxy.shr.secureserver.net:3128" bypassonlocal="False" />
</defaultProxy>
</system.net>

I still get a "connection failure" error.  Do I adjust something in the cfm file that points to this proxy server?
I currently have:

<cfhttp method="post" url="https://secure.authorize.net/gateway/transact.dll">

<cfhttpparam name="x_login" type="formfield" value="xxxxxxx">
<cfhttpparam name="x_tran_key" type="formfield" value="xxxxxxxxxxxxxxx">
<cfhttpparam name="x_method" type="formfield" value="CC">
<cfhttpparam name="x_type" type="formfield" value="AUTH_CAPTURE">
<cfhttpparam name="x_amount" type="formfield" value="1.00">
<cfhttpparam name="x_delim_data" type="formfield" value="TRUE">
<cfhttpparam name="x_delim_char" type="formfield" value="|">
<cfhttpparam name="x_relay_response" type="formfield" value="FALSE">
<cfhttpparam name="x_card_num" type="formfield" value="4111111111111111">
<cfhttpparam name="x_exp_date" type="formfield" value="07/09">

</cfhttp>

<cfset api_response=cfhttp.fileContent>
<cfoutput>#api_response#</cfoutput>

calling all coldfusion experts.  any help is greatly appreciated.  
0
Comment
Question by:COwebmaster
  • 16
  • 9
  • 3
28 Comments
 
LVL 36

Accepted Solution

by:
SidFishes earned 150 total points
ID: 21813206
" they said I need a web.config file on the root of my file server" - this doesn't make sense if you are on a shared host and even less since web.config is the asp.net config file... has nothing to do with coldfusion. Think the support person had no idea what they were talking about...

however, you still may be able to get it to work

try

<cfhttp method="post" url="https://secure.authorize.net/gateway/transact.dll"
     proxyServer = "http://proxy.shr.secureserver.net"
     proxyport="3128"
>




0
 

Author Comment

by:COwebmaster
ID: 21813314
yep tried that and added more into the tag and I still get a connection failure.

<cfhttp
method="post"
url="https://secure.authorize.net/gateway/transact.dll"
proxyServer="http://proxy.shr.secureserver.net:3128"
proxyPort="3128"
port="3128"
proxyUser = "xxxx"
proxyPassword = "xxxx"
username = "xxxx"
password ="xxxx"

>
<cfhttpparam name="x_login" type="formfield" value="xxxxxxx">
<cfhttpparam name="x_tran_key" type="formfield" value="xxxxxxxxxxxxxxxx">

</cfhttp>

is there an alternative to using cfhttp?  Does anyone know if godaddy has blocked cfhttp?  I was on the phone with godaddy customer support for an hour and a half last night and eve their tech person who knows coldfusion didn't know what was going on. ??
0
 

Author Comment

by:COwebmaster
ID: 21813498
I just added that code above on my other godaddy host account where it was working before (without the proxy info) and it gets a connection failure.  I remove the proxy info and it works.  Godaddy said yesterday that this other account that does work without using the proxy is a fluke.  any idea why?
0
 
LVL 36

Assisted Solution

by:SidFishes
SidFishes earned 150 total points
ID: 21813520
you've got the port listed in the proxyserver param

proxyServer="http://proxy.shr.secureserver.net:3128"
                                                                            ^

remove it and try again

proxyServer="http://proxy.shr.secureserver.net"

also try using the ip..cfhttp sometimes has issues resolving dns

proxyServer="http://64.202.165.130"


an excellent cfhttp replacement ($50 but I use it in business critical apps.)
http://www.cftagstore.com/tags/cfxhttp5.cfm
0
 

Author Comment

by:COwebmaster
ID: 21813669
tried all that and still get a "connection failure"
0
 

Author Comment

by:COwebmaster
ID: 21813751
would it matter that i have a dedicated ip on these 2 accounts and its interferring with the proxy server?  what is the purpose of the proxy server?
0
 
LVL 36

Assisted Solution

by:SidFishes
SidFishes earned 150 total points
ID: 21813946
the proxy just passes on the request... depending on how it is set up it may or may not modify the request.

you could try adding the following 2 tags which are known to help with user agent and compression related connection failures

<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">

but...that being said 90% of connection failures using cfhttp with ssl are certificate related. I still believe this is the root of the problem and you should ask tech support to run the keystore update on your server.



0
 
LVL 4

Assisted Solution

by:msfletch
msfletch earned 350 total points
ID: 21814604
From SidFishes [msfletch - any ideas here
 http://www.experts-exchange.com/Software/Server_Software/Web_Servers/ColdFusion/Q_23493712.html (godaddy/cfhttp/ssl)]

I really don't know much about this subject. As such, I am hesitant to offer suggestions that might send someone in the completely wrong direction.

That being said, I did find some information with people havig success using cURL (instead of CFHTTP) on GoDaddy to talk to outside services. Again, I have no experience with this, but here are a couple of sites explaining more:

Thread about cURL requirments and settings on GoDaddy:
http://forums.creloaded.com/Forums/viewtopic/t=22494.html

Thread with info on using cURL with ColdFusion:
http://objectmix.com/cold-fusion/410708-example-curl-coldfusion.html

cURL Main Site:
http://curl.haxx.se/docs/faq.html

0
 

Author Comment

by:COwebmaster
ID: 21814779
yes, godaddy does support cURL and they provided me a script on their site but it appears to be for php hosting sites.  mine is coldfusion:

<?
$URL="https://www.paypal.com";
if (isset($_GET["site"])) { $URL = $_GET["site"]; }
$ch = curl_init();
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);
$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";
?>

I also learned that I have cURL disabled.  how do enable it first of all in my shared host account (do I do that or does the support team?), then create coldfusion cURL script?
0
 
LVL 4

Assisted Solution

by:msfletch
msfletch earned 350 total points
ID: 21814987
Sorry COWebMaster, I am at the end of my knowledge about cURL and Authorize.net.

Not sure where the settings/enablings are handled, I would ask them. I know cURL can be used with ColdFusion. The second link above uses cURL with a <cfexecute> to grab content from a page. More detail on how to use it for other things can be found at the third link.

I know the documentation is largely for PHP, and unfortunately the only examples I can find with CF don't involve Authorize.net, but combining the info about using with CF and the info about how to use it may produce some fruits. Sorry I cannot be of more help there. I would be interested to know how this is ultimately resolved.

Some more links that may prove useful:

Ray Camden uses cURL to connect to subversion:
http://www.coldfusionjedi.com/index.cfm/2006/12/9/ColdFsion-handling-of-Subversion-events

More on using cURL with CF:
http://blogs.sanmathi.org/ashwin/2006/09/14/howto-call-cf-from-the-command-line/

0
 

Author Comment

by:COwebmaster
ID: 21815085
I was able to get a connection on my php account using the curl provided by godaddy.  I just have to figure out how to convert the scipt to cfm.
0
 

Author Comment

by:COwebmaster
ID: 21816589
I've searched all day for cURL examples for use in coldfusion or asp.  could find any.  any ideas?
0
 
LVL 4

Assisted Solution

by:msfletch
msfletch earned 350 total points
ID: 21817043
Have you seen this thread?

https://store1.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=1352314&enterthread=y

It shows the basic format:

<cfset args = "x_username=#urlencodedformat('[Email Addy Username]')#&x_password=[Hexed password]&x_command=get_ip_usage_report&x_cust_id=[customer Number]&x_start_date=2008-04-01&x_end_date=2008-04-01 https://[Third party URL]">
<cfexecute name="C:\cURL\curl.exe"
      arguments="-v -S -k -2 -d #args#" outputFile="c:\temp\stuff.txt">            
</cfexecute>
0
 

Author Comment

by:COwebmaster
ID: 21817089
I did downlod that exe file but unfortunately, godaddy doesn't allow the use of the cfexecute tag.  is there a way to rewrite those lines of code so it works without cfexecute or cfobject?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 4

Assisted Solution

by:msfletch
msfletch earned 350 total points
ID: 21817182
0
 

Author Comment

by:COwebmaster
ID: 21817235
I get this..

Security: The requested template has been denied access to createobject
0
 

Author Comment

by:COwebmaster
ID: 21817372
could I use CFinvoke in place of createObject?
0
 

Author Comment

by:COwebmaster
ID: 21817434
godaddy says "You will need to set the proxy connection via a web.config file in your account." any ideas what the file would contain?
0
 
LVL 4

Assisted Solution

by:msfletch
msfletch earned 350 total points
ID: 21817455
Good question. Check out:

http://www.coldfusionjedi.com/index.cfm/2006/4/5/Ask-a-Jedi-cfinvoke-versus-createObject

As far as the error you get ... it might be worth asking them if they can allow that, although most likely they have blocked it just like they block CFEXECUTE.

The only other thing I can think of for replacing CFEXECUTE (barring your suggestion above) is a CFX custom tag, although for some reason I can see them not allowing that as well. Check out:

http://www.intrafoundation.com/software/CFX_Execute.htm

Other than that, there has to be a way. I can't imagine that with all the people using GoDaddy and Authorize.net no one has figured this out. The sheer lack of threads about it makes me suspicious that it is not normally a problem. The fact that your other account works (and they call it a fluke) seems to support that theory.

The support is the one thing at GoDaddy where I shrug and say "Well, you get what you pay for." Sometimes just getting someone else on the phone changes the whole landscape.

Anyway ... good luck!
0
 
LVL 4

Assisted Solution

by:msfletch
msfletch earned 350 total points
ID: 21817503
I believe the web.config file is for IIS in general, not just ASP. ColdFusion is likely piggy-backing on the IIS server, so changing the settings there may have an effect. I don't readily know where that file is or how to change it. GoDaddy support should have some documentation on that.
0
 

Author Comment

by:COwebmaster
ID: 21817526
yea, according to them I need to place the proxy server proxy port in that web.config file.
0
 

Author Comment

by:COwebmaster
ID: 21817559
This is what they gave me to put on my file server:

<system.net>
<defaultProxy>
<proxy usesystemdefault="False" proxyaddress="http://proxy.shr.secureserver.net:3128" bypassonlocal="False" />
</defaultProxy>
</system.net>

how would I reference it in my coldfusion page?  am I still to use the cfhttp with this web.config file?
0
 
LVL 4

Assisted Solution

by:msfletch
msfletch earned 350 total points
ID: 21817582
You should not have to reference it directly from ColdFusion. I would try the cfhttp code again.
0
 

Author Comment

by:COwebmaster
ID: 21817597
didn't work
0
 
LVL 4

Assisted Solution

by:msfletch
msfletch earned 350 total points
ID: 21817635
Did you try it both with the proxy and without the proxy defined? Also, they may have to restart your virtual server for the new settings to take effect. Sometimes IIS is touchy that way.
0
 

Author Comment

by:COwebmaster
ID: 21823014
GOT IT TO WORK!!!

Problem was the url to the proxy server was wrong.  I was putting 'http://' in front of proxy.shr.secureserver.net.

<cfhttp method="post" url="https://secure.authorize.net/gateway/transact.dll" proxyServer="proxy.shr.secureserver.net" proxyPort="3128" >
0
 
LVL 4

Expert Comment

by:msfletch
ID: 21823138
Glad you were able to get it working.
0
 

Author Comment

by:COwebmaster
ID: 21823173
Thx for everyone's help!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now