Posts: 2
Registered: ‎03-16-2012

GetTransactionDetails (Transaction Details API) with Classic ASP

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?




Posts: 1,476
Topics: 33
Kudos: 34
Solutions: 126
Registered: ‎09-14-2009

Re: GetTransactionDetails (Transaction Details API) 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.

John Conde :: Certified Authorize.Net Developer (Brainyminds) :: Official Authorize.Net Blogger

NEW! Handling Authorize.Net's Webhooks with PHP

Integrate Every Authorize.Net JSON API with One PHP Class (Sample code included)

Tutorials for integrating Authorize.Net with PHP: AIM, ARB, CIM, Silent Post
All About Authorize.Net's Silent Post
Posts: 2
Registered: ‎03-16-2012

Re: GetTransactionDetails (Transaction Details API) with Classic ASP

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 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 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 = ""
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
SOAPRequest = _
    "<?xml version=""1.0"" encoding=""utf-8""?>" &_
    "<soap12:Envelope xmlns:soap="""" xmlns:xsd="""" xmlns:soap12="""">" &_
    "  <soap12:Body>" &_
    "     <GetTransactionDetails xmlns="""">" &_
    "       <merchantAuthentication>" &_
    "         <name>" & objRS("ProcessVendor") & "</name>" &_
    "         <transactionKey>" & objRS("ProcessPass") & "</transactionKey>" &_
    "       </merchantAuthentication>" &_
    "       <transId>" & objRS("Reference_Number") & "</transId>" &_
    "     </GetTransactionDetails>" &_
    "  </soap12:Body>" &_
xmlhttp.Open "POST", GatewayHost, False
xmlhttp.setRequestHeader "Content-Type""text/xml; charset=utf-8"
xmlhttp.setRequestHeader "SOAPAction"""
xmlhttp.Send SOAPRequest

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!