H E L P !!!!!
I'm new to authorize.net and have created a test page using the sample code provided but I'm having issues.
1) It doesn't work... Here's the results I'm getting:
3
1
103
This transaction cannot be accepted.
P
0
1.00
CC
auth_only
490C4A89E10A4B3FDFDF73E186105766
8k9SfYv95M9QH8qJ
2) How do I pick up the variable names so I can provide a correct response?
I'm trying to use a cfif statement to determine what happens on my end but it's a no go.
Example:
<cfif #x_response_code IS "1">
Transaction approved
<cfelse>
Transaction error!
</cfif>
Solved! Go to Solution.
07-28-2012 05:22 PM
I'm posting this to help anybody else trying to figure this out because the sample code provided leaves a little to be desired.
Turns out the problem was with the delimiter being returned (not being a comma) and the fact that I was leaving the delimeter field out of the ColdFusion ListGetAt function. The other part of the problem is that there is a lot of lazy sample code posted on the net.
Here's what you are looking for...
<cfset api_response = #cfhttp.fileContent#>
<cfset authcode = #ListGetAt(api_response, "1", "|")#>
<!--- here you would add additional cfset tags to set the value of other returned info for later processing --->
<cfif #authcode# EQ "1">
Transaction success.
<cfelseif #authcode# EQ "2">
Transaction declined.
<cfelseif #authcode# EQ "3">
Transaction error.
<cfelse>
You're having another problem.
</cfif>
<!--- Within that cfif statement you add additional processing of the data based on the data you set values for above. --->
07-29-2012 07:59 AM
Follow up post.
I'm setting the value of the list returned by authorize.net as follows:
<cfset api_response=cfhttp.filecontent>
Then I'm setting a value to the authorization code...
<cfoutput>
<cfset code = #ListGetAt(api_response,1)#>
<cfif #code# EQ "1">
The transaction was successful!
<efelse>
The transaction was not successful.
</cfif>
</cfoutput>
The problem is that it is returning a blank page instead of the right code.
07-28-2012 06:42 PM
I'm posting this to help anybody else trying to figure this out because the sample code provided leaves a little to be desired.
Turns out the problem was with the delimiter being returned (not being a comma) and the fact that I was leaving the delimeter field out of the ColdFusion ListGetAt function. The other part of the problem is that there is a lot of lazy sample code posted on the net.
Here's what you are looking for...
<cfset api_response = #cfhttp.fileContent#>
<cfset authcode = #ListGetAt(api_response, "1", "|")#>
<!--- here you would add additional cfset tags to set the value of other returned info for later processing --->
<cfif #authcode# EQ "1">
Transaction success.
<cfelseif #authcode# EQ "2">
Transaction declined.
<cfelseif #authcode# EQ "3">
Transaction error.
<cfelse>
You're having another problem.
</cfif>
<!--- Within that cfif statement you add additional processing of the data based on the data you set values for above. --->
07-29-2012 07:59 AM