I am trying to integrate ARB using classic ASP. There is no sample code available from Authorize.net for this. I followed the PHP code and the reference guide to set up the XML file, but I am confused how to post this to authorize.net in order to get a response back.
in AIM for a single transaction, there were several methods of posting. I successfully used this method:
Set objHTTP = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
objHTTP.Open "GET", "https://secure.authorize.net/gateway/transact.dll?" & vPostData, false
strRetval = objHTTP.ResponseText
Do I use something similar for ARB? If so, how do I correctly send the XML file using this? There were other options in the AIM guide, such as XMLHTTP - should I use that?
I would assume that someone has done this before, and I just need a few lines of code to finish up this aspect of the project. Thank you.
Have you read the ARB PDF guide? All you pretty much have to do is POST the XML payload to one of the API urls and parse the results.
I would check a ASP programming forum or Stackoverflow on how to post XML data with ASP.
I have read the ARB guide, but it provides no information on how to post the XML file.
I used the AIM code that posted a message using XMLHTTP, and modified it slightly to post the ARB XML file:
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.open "get", "https://api.authorize.net/xml/v1/request.api", false
strStatus = xml.Status
strRetval = xml.responseText
Set xml = nothing
It doesn't work.
Error code :E00002 (The content-type specified is not supported)
Do you know what I need to do to correct this error? The XML that I am submitting seems to be well-formed, as you can see below:
<?xml version="1.0" encoding="utf-8"?>
I've been using this classic asp ARB snippet for years... just replace the info with your own.... hope it helps:
sefi thanks for this - but the code is for AIM, not for ARB (Irecurring billing). for example - your code doesnt ask how long the subscription is , how oten to charge the card etc...
do you have sample for ARB ?