Reply
Highlighted
Member
Posts: 4
Registered: ‎07-05-2012

Re: Setting up ARB using ASP Classic

hi dzarro

 

 

    actully i tried on your code...but its showing invalid token...valiid token is "or"...what does it mean?

Highlighted
Member
Posts: 4
Registered: ‎07-05-2012

Re: Setting up ARB using ASP Classic

Hi Michell....

 

 

         i Tried with u r instruction...but still its not working...can u send me the correct code classic asp

Highlighted
All Star
Posts: 1,072
Registered: ‎08-17-2009

Re: Setting up ARB using ASP Classic

Hey again,

 

We don't have sample code for ARB in ASP Classic. If that's what you're looking for, you'll need to find that elsewhere. If you're having a problem with any of the code we do have in ASP, then you can post the code and the response you're getting and we can try to troubleshoot.

 

Thanks,

 

Michelle

Developer Community Manager

Highlighted
Member
Posts: 5
Registered: ‎10-15-2013

Re: Setting up ARB using ASP Classic

how disappointing that you cant supply sample code for ASP

Highlighted
Member
Posts: 2
Registered: ‎02-18-2015

Re: Setting up ARB using ASP Classic

Some of you all have requested sample code.  Based on dzarro's original code and later comments, I put together working code for ARB entry using ASP Classic.  Here you go:

 

<%

KID = "recurtest"
theName = "Recur TEST Member Subscription"
theDate = "2015-05-27"
numOccur = "12"
amt = "423.45"

txtCCExp = "2029-07"
txtCCNum = "4111111111111111"
txtBillingFName = "Test"
txtBillingLName = "Person"
txtBillingAddress = "123 E. 4th"
txtBillingZip  = "12345"


strTransKey = "xxxxxxxxxxxxxxxx" 
apiLogin = "xxxxxxxxxxx"
post_url = "https://apitest.authorize.net/xml/v1/request.api"

 


strXml = "<?xml version='1.0' encoding='utf-8'?>"
strXml = strXml & "<ARBCreateSubscriptionRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'>"
strXml = strXml & "<merchantAuthentication>"
strXml = strXml & "<name>" & apiLogin & "</name>"
strXml = strXml & "<transactionKey>" & strTransKey & "</transactionKey>"
strXml = strXml & "</merchantAuthentication>"
strXml = strXml & "<refId>" & KID & "</refId>"
strXml = strXml & "<subscription>"
strXml = strXml & "<name>" & theName & "</name>"
strXml = strXml & "<paymentSchedule>"
strXml = strXml & "<interval>"
strXml = strXml & "<length>1</length>"
strXml = strXml & "<unit>months</unit>"
strXml = strXml & "</interval>"
strXml = strXml & "<startDate>" & theDate & "</startDate>"
strXml = strXml & "<totalOccurrences>" & numOccur & "</totalOccurrences>"
'strXml = strXml & "      <trialOccurrences>1</trialOccurrences>" & vbcrlf
strXml = strXml & "</paymentSchedule>"
strXml = strXml & "<amount>" & amt & "</amount>"
'strXml = strXml & "    <trialAmount>0.00</trialAmount>" & vbcrlf
strXml = strXml & "<payment>"
strXml = strXml & "<creditCard>"
strXml = strXml & "<cardNumber>" & txtCCNum & "</cardNumber>"
strXml = strXml & "<expirationDate>" & txtCCExp & "</expirationDate>"
strXml = strXml & "</creditCard>"
strXml = strXml & "</payment>"
strXml = strXml & "<billTo>"
strXml = strXml & "<firstName>" & txtBillingFName & "</firstName>"
strXml = strXml & "<lastName>" & txtBillingLName & "</lastName>"
strXml = strXml & "<address>" & txtBillingAddress & "</address>"
strXml = strXml & "<zip>" & txtBillingZip & "</zip>"
strXml = strXml & "</billTo>"
strXml = strXml & "</subscription>"
strXml = strXml & "</ARBCreateSubscriptionRequest>"

 

 

Set objXMLDOC = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
Set objXMLDOM = Server.CreateObject("Msxml2.DomDocument")
Set oNode = Server.CreateObject("Microsoft.XMLDOM")

 

'SET CALL TIMEOUTS
lResolve = 8 * 1000 'Timeout values are in milli-seconds
lConnect = 8 * 1000
lSend = 10 * 1000
lReceive = 10 * 1000
objXMLDOC.setTimeouts lResolve, lConnect, lSend, lReceive

 

'MAKE THE CALL
objXMLDOC.open "POST", post_url, False
objXMLDOC.setRequestHeader "Content-Type", "text/xml"
objXMLDOC.send(strXml)
objXMLDOM.async = false
objXMLDOM.LoadXML objXMLDOC.responseText

 

'output response to screen (view source to see tags)

'response.write objXMLDOC.responseText & "<br/><br/>"

 

'PROCESS THE CALL
If objXMLDOM.parseError.errorCode <> 0 Then 'parser error found
 Response.Write "parser error found"
Else 'no parser error
 'BEGIN CHECK FOR ERROR FROM Authorize.net
 'Set oNode = objXMLDOM.getElementsByTagName("*")
 'Response.Write "oNode length = " & oNode.length & "<br>"
 Set oNode = objXMLDOM.getElementsByTagName("resultCode")
 If (oNode.item(0).text="Error") Then
  Set oNode = objXMLDOM.getElementsByTagName("text")
  Response.Write "Error: " & oNode.item(0).text & "<br>"
 Else
  'PROCESS SUCCESSFUL CALL
  Set oNode = objXMLDOM.getElementsByTagName("subscriptionId")
  If (Not oNode Is Nothing) Then
   Response.Write "subscriptionId returned " & oNode.item(0).text & "<br>"
  else
   Response.Write "subscriptionId not returned" & "<br>"
  End If
 End If

 Set oNode = Nothing

End If

 

Set objXMLDOC = Nothing
Set objXMLDOM = Nothing
%>

Highlighted
Member
Posts: 2
Registered: ‎04-14-2016

Re: Setting up ARB using ASP Classic

Where I can I get the ASp sample code? it's not on the samples page anywhere...