03-17-2010 07:17 AM
Have you solved your problem yet. I am also using Access and the solution is fairly simple (after trying to do it the hard way).
09-22-2010 11:39 AM
I would like some more information about this. We cant find any MS Access sample code to connect to authorize.net anywhere. Is it even possible?
10-20-2010 09:23 PM
Yes it is possible. Look at the sample code page.
Under the first heading Advanced Integration Method (AIM) download the AIM - ASP Classic code.
This is actually vb script code (almost VBA). Copy and paste into a Access module, delete or comment out the HTML, and make the vb script a public subroutine called "test."
I removed the reference to "Scripting.Dictionary" and built post_values (as a string) manually, just for testing purposes.
Also set a reference to "Microsoft XML, v6.0" then remove the line:
Set objRequest = Server.CreateObject("Microsoft.XMLHTTP")
and add the lines:
Dim objRequest As MSXML2.XMLHTTP
At the end of the code replace the Response.Write routine with Debug.Print in a loop.
It been a while since I did this so you will have to clean up some of the other code also.
Add your testing credentials and run the code. Keep me posted with your results.
10-21-2010 09:56 AM
Thanks for this i was looking for such help for a while.
1 thing i canot figure out is the line below:
I removed the reference to "Scripting.Dictionary" and built post_values (as a string) manually, just for testing purposes.
how to built the post_values, if you can please give some detail instrutions.
Thanks so much
05-01-2011 12:49 PM
You are building the post_string something like:
Public Sub test()
Dim Post_Url
Post_Url = "https://test.authorize.net/gateway/transact.dll"
'post_url = "https://secure.authorize.net/gateway/transact.dll"
Dim post_string As String
Dim post_response As String
'the API Login ID and Transaction Key must be replaced with valid values
post_string = ""
post_string = post_string & "x_login=" & URLEncode("API_LOGIN_ID") & "&"
post_string = post_string & "x_tran_key=" & URLEncode("TRANSACTION_KEY") & "&"
post_string = post_string & "x_delim_data=" & URLEncode("TRUE") & "&"
post_string = post_string & "x_delim_char=" & URLEncode("|") & "&"
post_string = post_string & "x_relay_response=" & URLEncode("FALSE") & "&"
post_string = post_string & "x_type=" & URLEncode("AUTH_CAPTURE") & "&"
post_string = post_string & "x_method=" & URLEncode("CC") & "&"
post_string = post_string & "x_card_num=" & URLEncode("4111111111111111") & "&"
post_string = post_string & "x_exp_date=" & URLEncode("0115") & "&"
post_string = post_string & "x_amount=" & URLEncode("19.98") & "&"
post_string = post_string & "x_description=" & URLEncode("Sample Transaction") & "&"
post_string = post_string & "x_first_name=" & URLEncode("John") & "&"
post_string = post_string & "x_last_name=" & URLEncode("Doe") & "&"
post_string = post_string & "x_address=" & URLEncode("1234 Street") & "&"
post_string = post_string & "x_state=" & URLEncode("WA") & "&"
post_string = post_string & "x_zip=" & URLEncode("98004") & "&"
' Additional fields can be added here as outlined in the AIM integration
' guide at: http://developer.authorize.net
post_string = Left(post_string, Len(post_string) - 1)
' We use xmlHTTP to submit the input values and record the response
Dim objRequest As New MSXML2.XMLHTTP
objRequest.Open "POST", Post_Url, False
objRequest.send post_string
post_response = objRequest.responseText
Debug.Print post_response
Set objRequest = Nothing
' the response string is broken into an array using the specified delimiting character
Dim response_array '(100) As String
response_array = Split(post_response, "|", -1)
' now use Debug.Print to write out response_array
End Sub
Public Function URLEncode(xxx As String) As String
URLEncode = Replace(xxx, " ", "%20")
End Function
This really old code I found laying around but it still works.
05-02-2011 09:38 AM
Thank you. This code works perfect. I did not put the code in a module. Instead i put it directly behind a form. Easier I think. :smileyhappy:
02-20-2012 11:07 PM
03-20-2012 01:15 PM
Do you have an sample VBA code for the Transaction Details API (downloading the settled batch list , transacion list for speicified batches, unsettled transactions list etc)
Thanis
05-04-2012 08:14 AM
05-08-2012 08:25 AM