cancel
Showing results for 
Search instead for 
Did you mean: 

ColdFusion AIM integration

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>

 

 

rlichner
Member
1 ACCEPTED SOLUTION

Accepted Solutions

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. --->

View solution in original post

2 REPLIES 2

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.

rlichner
Member

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. --->