Hello All,
I am using Authorize.net's Transaction Details API with Classic ASP with the following sample code that works!
I have a Classic ASP Script that goes out to Authorize.net's Transaction Detail API to see what customers have declined. The script work great except for two issues I have.
1. How do you show itemized items ex: Response.Write objResponse.selectSingleNode("/*/api:declineCount").Text
2. I can't figure out how I could link this info with my customers. My database stories the customer's Subscription ID but it doesn't seem to be included in the Output of the API.
Any help or suggestions great appreciated!
Thanks in advance for the help!
Francis G
************************************************************
* SCRIPT BELOW TO PULL TRANSACTION DETAILS...
************************************************************
strXML = "<?xml version=""1.0"" encoding=""utf-8""?>"
strXML = strXML & "<getSettledBatchListRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">"
strXML = strXML & "<merchantAuthentication>"
strXML = strXML & "<name>XXXXXXXXX</name>"
strXML = strXML & "<transactionKey>XXXXXX</transactionKey>"
strXML = strXML & "</merchantAuthentication>"
strXML = strXML & "<includeStatistics>true</includeStatistics>"
strXML = strXML & "<firstSettlementDate>2012-08-03T00:19:38Z</firstSettlementDate>"
strXML = strXML & "<lastSettlementDate>2012-08-04T00:19:38Z</lastSettlementDate>"
strXML = strXML & "</getSettledBatchListRequest>"
post_url = "https://api.authorize.net/xml/v1/request.api"
'Start to process and post the XML data to authorize.net.
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.open "post", post_url, False
objHTTP.setRequestHeader "Content-Type", "text/xml"
'Send the XML off to Authorize.net
objHTTP.send strXML
'Show the response from authorize.net.
Response.Write "Raw response: " & Server.HTMLEncode(objHTTP.responseText)
'Parse the returned XML from authorize.net to see what the charge results were.
Set objResponse = Server.CreateObject("MSXML2.DOMDocument.4.0")
objResponse.loadXML objHTTP.responseText
objResponse.setProperty "SelectionNamespaces", "xmlns:api='AnetApi/xml/v1/schema/AnetApiSchema.xsd'"
Response.Write objResponse.selectSingleNode("/*/api:declineCount").Text
08-06-2012 01:16 PM - edited 08-06-2012 01:30 PM
BTW Here is the response I get from the script above:
Raw response: <?xml version="1.0" encoding="utf-8"?><getSettledBatchListResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><batchList><batch><batchId>XXXXXXXX</batchId><settlementTimeUTC>2012-08-03T23:38:03Z</settlementTimeUTC><settlementTimeLocal>2012-08-03T19:38:03</settlementTimeLocal><settlementState>settledSuccessfully</settlementState><paymentMethod>creditCard</paymentMethod><statistics><statistic><accountType>AmericanExpress</accountType><chargeAmount>19.95</chargeAmount><chargeCount>1</chargeCount><refundAmount>0.00</refundAmount><refundCount>0</refundCount><voidCount>0</voidCount><declineCount>0</declineCount><errorCount>0</errorCount></statistic><statistic><accountType>MasterCard</accountType><chargeAmount>39.90</chargeAmount><chargeCount>2</chargeCount><refundAmount>0.00</refundAmount><refundCount>0</refundCount><voidCount>0</voidCount><declineCount>1</declineCount><errorCount>0</errorCount></statistic><statistic><accountType>Visa</accountType><chargeAmount>19.95</chargeAmount><chargeCount>1</chargeCount><refundAmount>0.00</refundAmount><refundCount>0</refundCount><voidCount>0</voidCount><declineCount>2</declineCount><errorCount>0</errorCount></statistic></statistics></batch></batchList></getSettledBatchListResponse>
08-06-2012 01:23 PM
Hi Knuckles2002,
The getTransactionDetails API will give you the line item information, if that is what you are referring to.
Right now it is not possible to query ARB subscriptions using the Transaction Details API.You may want to check this previous thread for details.
Thanks,
Joy
08-10-2012 03:34 PM