I need to call the Transaction Details API with Classic ASP, but none of the samples or documentation is helping me understand how to make that call from ASP. How do I call GetTransactionDetails with Classic ASP?
It's an XNML API which is no different then ARB, CIM, and the AIM XML API. You can use the sample code for any of them to connect to it. All you need to do is change the XML you send over. You can easily figure that out by reading the documentation.
Well, that response wasn't terribly helpful, as I had noted that I've been looking through the documentation and hadn't had much luck figuring it out. It seems pretty standard to respond to what is perceived as a "dumb question" by simply replying "RTFM". The thing is, it's not the Authorize.net API that I needed help with, it's how to call it with ASP. I've never tried to call a SOAP service via ASP, and I was looking for examples on how to call the Authorize.net service with ASP, and haven't been able to find that.
So, I continued to research how it's done, and I'm not 100% there yet, but for the benefit of anyone who might be stuck in my same predicament - having to work with Classic ASP - here's what I've got so far (I never found anything in the documentation that looks anything like this, BTW):
GatewayHost = "https://api.authorize.net/soap/v1/Service.asmx" Set xmlhttp = CreateObject("Microsoft.XMLHTTP") SOAPRequest = _ "<?xml version=""1.0"" encoding=""utf-8""?>" &_ "<soap12:Envelope xmlns:soap=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">" &_ " <soap12:Body>" &_ " <GetTransactionDetails xmlns=""https://api.authorize.net/soap/v1/"">" &_ " <merchantAuthentication>" &_ " <name>" & objRS("ProcessVendor") & "</name>" &_ " <transactionKey>" & objRS("ProcessPass") & "</transactionKey>" &_ " </merchantAuthentication>" &_ " <transId>" & objRS("Reference_Number") & "</transId>" &_ " </GetTransactionDetails>" &_ " </soap12:Body>" &_ "</soap12:Envelope>" xmlhttp.Open "POST", GatewayHost, False xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8" xmlhttp.setRequestHeader "SOAPAction", "https://api.authorize.net/soap/v1/GetTransactionDetails" xmlhttp.Send SOAPRequest response.write(xmlhttp.responseText)
I can confirm that this results in getting the SOAP response back, but I cannot (so far) convert that (using xmlhttp.responseXml or the responseText, as shown above) to an XMLDocument, which should be pretty straight-forward, but haven't had luck with that yet. Since I only really need 1 piece of data, I might just cheat and parse the response text using standard string methods.
Hopefully that will help someone out!