The UNKNOWN ERROR does come from our code when it gets a response from AuthNet that is other than 1,2,3,4...see near the bottom of this code.
We do a secure post to this page AuthNetAim.cfm which then posts and gets info from AuthNet and displays a THANKS or Error info and then process further approved orders.
Thanks in advance ALL for any help. I see I am not the only one using a CF5/Win2000/2003 AIM code.
-Michael
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--- Value returned from Authnet are comma delimited by default, it is necessary to strip any commas in the submission --->
<cfset Delimiter=",">
<CFHTTP METHOD="POST"
URL="https://secure.authorize.net/gateway/transact.dll"
RESOLVEURL="YES">
<cfhttpparam type="FORMFIELD" name="x_Test_Request" value="False">
<cfhttpparam type="FORMFIELD" name="x_Email_Customer" value="true">
<cfhttpparam type="FORMFIELD" name="x_Email_Merchant" value="true">
<cfhttpparam type="FORMFIELD" name="x_Relay_Response" value="false">
<cfhttpparam type="FORMFIELD" name="x_Delim_Data" value="true">
<cfhttpparam type="FORMFIELD" name="x_Delim_Char" value=",">
<cfhttpparam type="FORMFIELD" name="x_login" value="#AuthNetLogin#">
<cfhttpparam type="FORMFIELD" name="x_tran_key" value="#AuthnetTransactionKey#">
<cfhttpparam type="FORMFIELD" name="x_version" value="3.1">
<cfhttpparam type="FORMFIELD" name="x_type" value="Auth_Capture">
<cfhttpparam type="FORMFIELD" name="x_Description" value="#Replace(Form.x_Description,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_Invoice_Num" value="#Replace(Form.x_Invoice_Num,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_Amount" value="#Replace(Form.x_Amount,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_method" value="#Replace(Form.x_method,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_card_num" value="#Replace(Form.x_card_num,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_exp_date" value="#Replace(Form.x_exp_date,"#Delimiter#","","all")#">
<!--- <cfhttpparam type="FORMFIELD" name="x_bank_aba_code" value="#Replace(Form.x_bank_aba_code,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_bank_acct_num" value="#Replace(Form.x_bank_acct_num,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_bank_acct_type" value="#Replace(Form.x_bank_acct_type,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_bank_name" value="#Replace(Form.x_bank_name,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_bank_acct_name" value="#Replace(Form.x_bank_acct_name,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_echeck_type" value="Web"> --->
<cfhttpparam type="FORMFIELD" name="x_First_Name" value="#Replace(Form.x_First_Name,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_Last_Name" value="#Replace(Form.x_Last_Name,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_Address" value="#Replace(Form.x_Address,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_City" value="#Replace(Form.x_City,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_state" value="#Replace(Form.x_state,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_country" value="#Replace(Form.x_country,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_Zip" value="#Replace(Form.x_Zip,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_Phone" value="#Replace(Form.x_Phone,"#Delimiter#","","all")#">
<cfhttpparam type="FORMFIELD" name="x_Email" value="#Replace(Form.x_Email,"#Delimiter#","","all")#">
</cfhttp>
<cfoutput>
<CFSCRIPT>
/**
* Fixes a list by replacing null entries.
* This is a modified version of the ListFix UDF
* written by Raymond Camden. It is significantly
* faster when parsing larger strings with nulls.
*
* @Param list The list to parse.
* @Param delimiter The delimiter to use. Defaults to a comma.
* @Param null Null string to insert. Defaults to "".
* @return Returns a list.
* @author Patrick McElhaney (pmcelhaney@amcity.com)
* @version 2, February 14, 2002
*/
function ListFix(list) {
var delim = ",";
var null = "Null";
if(arrayLen(arguments) gt 1) delim = arguments[2];
if(arrayLen(arguments) gt 2) null = arguments[3];
list = replace(list,"#delim##delim#", "#delim##null##delim#", "ALL");
list = replace(list,"#delim##delim#", "#delim##null##delim#", "ALL");
if (left(list, 1) eq delim) list = "#null##list#";
if (right(list, 1) eq delim) list = "#list##null#";
return list;
}
</CFSCRIPT>
<!--- Auth Net version 3.1 returns 68 fields. Any users fields will be added after that. Fields 40 to 68 are not used
by Auth net but are reserved for future use --->
<cfset TheList=ListFix(CFHTTP.FileContent)>
<cfset TheDelimiter=Delimiter>
<!--- Set a default --->
<cfset ProcessorResponse="UnknownError">
<!--- Convert Response Code --->
<!--- Approved --->
<cfif ListGetAt(TheList,1,TheDelimiter) is "1">
<cfset ProcessorResponse="Approve">
<!--- Disapproved --->
<cfelseif ListGetAt(TheList,1,TheDelimiter) is "2">
<cfset ProcessorResponse="Decline">
<cfset DeclineReason=ListGetAt(TheList,4,TheDelimiter)>
<!--- Error --->
<cfelseif ListGetAt(TheList,1,TheDelimiter) is "3">
<cfset ProcessorResponse="Error">
<cfset ErrorCode=ListGetAt(TheList,3,TheDelimiter)>
<cfelse>
</cfif>
</cfoutput>
<HTML>
<HEAD>
<title> Secure Invoice</title>
</HEAD>
<body bgcolor="Green" background="bg2.jpg">
<table width="1000" border="0" align="CENTER" valign="TOP">
<CFOUTPUT>
<!--- Processor Approved --->
<cfif ProcessorResponse is "Approve">
<H3 ALIGN="CENTER">Thank you for placing your order online.
<br><br>
</H3>
<h4 align="center">To cancel or change your order you must contact us </h4>
<!--- Disapproved --->
<cfelseif ProcessorResponse is "Decline">
<div align="center">The transaction was not approved.<br>
Reason: #DeclineReason#<br>
</div>
<!--- Error --->
<cfelseif ProcessorResponse is "Error">
<div align="center">There was an error processing the transaction.(#ErrorCode#)</div>
<cfelse>
Unknown Error
</cfif>
</cfoutput>
</td>
</tr>
</table>
</BODY>
</HTML>
<cfif ProcessorResponse IS "Approve">
<cfinclude template="ProcessInvoice.cfm">
</cfif>