cancel
Showing results for 
Search instead for 
Did you mean: 

AIM - No response after submission

Hello All,

We had this code on a Server 2000 machine and after moving them to Server 2008 the process errors out. The code inserts the data into our dB and seems like its trying to process with Authorize but stops at 500 - Internal server error.

Any ideas? Thanks!

 

'Authorize.Net Code

' By default, this sample code is designed to post to our test server for ' developer accounts: https://test.authorize.net/gateway/transact.dll ' for real accounts (even in test mode), please make sure that you are ' posting to: https://secure.authorize.net/gateway/transact.dll

Dim post_url post_url = "https://secure.authorize.net/gateway/transact.dll"             '"https://test.authorize.net/gateway/transact.dll"  test account Dim post_values Set post_values = CreateObject("Scripting.Dictionary") post_values.CompareMode = vbTextCompare

'the API Login ID and Transaction Key must be replaced with valid values

 

post_values.Add "x_login", "xxxxxxxx"

post_values.Add "x_tran_key", "XXXXXXXXXXXXXXXX"

 

post_values.Add "x_delim_data", "TRUE"

post_values.Add "x_delim_char", "|"

post_values.Add "x_relay_response", "FALSE"

post_values.Add "x_type", "AUTH_CAPTURE"

post_values.Add "x_method", "CC"

post_values.Add "x_card_num", sCCnbr

post_values.Add "x_exp_date", sCCdate

post_values.Add "x_amount", sAmt

post_values.Add "x_description", sDescription

post_values.Add "x_first_name", sFname

post_values.Add "x_last_name", sLname

post_values.Add "x_company", sOrg

post_values.Add "x_address", sAddress

post_values.Add "x_state", sState

post_values.Add "x_zip", sZip

post_values.Add "x_email", sEmail

post_values.Add "x_email_customer", "Y"

post_values.Add "x_merchant_email", "cbaillie@uttc.edu"

 

' Additional fields can be added here as outlined in the AIM integration ' guide at: http://developer.authorize.net

' This section takes the input fields and converts them to the proper format ' for an http post.  For example: "x_login=username&x_tran_key=a1B2c3D4"

 

Dim post_string

post_string = ""

For Each Key In post_values   post_string=post_string & Key & "=" & Server.URLEncode(post_values(Key)) & "&"

Next

post_string = Left(post_string,Len(post_string)-1)

 

' We use xmlHTTP to submit the input values and record the response

Dim objRequest, post_response

Set objRequest = Server.CreateObject("Microsoft.XMLHTTP")  

       objRequest.open "POST", post_url, false  

       objRequest.send post_string  

       post_response = objRequest.responseText

Set objRequest = nothing

 

' the response string is broken into an array using the specified delimiting character

 

Dim response_array r

esponse_array = split(post_response, post_values("x_delim_char"), -1)

 

' the results are output to the screen in the form of an html numbered list.

 

'Response.Write("<OL>" & vbCrLf) 'For Each value in response_array ' Response.Write("<LI>" & value & "&nbsp;</LI>" & vbCrLf) 'Next 'Response.Write("</OL>" & vbCrLf)

' individual elements of the array could be accessed to read certain response ' fields.  For example, response_array(0) would return the Response Code, ' response_array(2) would return the Response Reason Code. ' for a list of response fields, please review the AIM Implementation Guide

 

'END Authorize.Net Code

 

'Response.Redirect("reg_thanks.asp")

'Server.Execute("reg_thanks.asp")

response.end

%>

cbaillie
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

Figured it out.

 

Changed:

Set objRequest = Server.CreateObject("Microsoft.XMLHTTP")

to

Set objRequest = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")

 

and installed MSXML 4.0 SP3 http://www.microsoft.com/download/en/details.aspx?id=15697

 

Hope this info can help!

 

View solution in original post

2 REPLIES 2

Pulled this error some the tracelog. Line 226 in red.

 

' We use xmlHTTP to submit the input values and record the response

Dim objRequest, post_response

Set objRequest = Server.CreateObject("Microsoft.XMLHTTP")

    objRequest.open "POST", post_url, false  

    objRequest.send post_string  

    post_response = objRequest.responseText

Set objRequest = nothing

 

 

LineNumber ErrorCode Description
226
800a0005
Invalid procedure call or argument
cbaillie
Contributor

Figured it out.

 

Changed:

Set objRequest = Server.CreateObject("Microsoft.XMLHTTP")

to

Set objRequest = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")

 

and installed MSXML 4.0 SP3 http://www.microsoft.com/download/en/details.aspx?id=15697

 

Hope this info can help!