Using anet_dotnet_sdk-1.5.0? in C# VS 2008 Pro,
all sources loaded into solutionusing the Transaction Details API
Modified the QuickStart SampleReporting application as follows:
var gate = new ReportingGateway("myid", "mykey", ServiceMode.Live);
DateTime to = DateTime.Today;
DateTime from = DateTime.Today.AddDays(-7);
var transactions = gate.GetTransactionList(from, to);
foreach (var trans in transactions) {
var detail = gate.GetTransactionDetails(trans.TransactionID);
etc
What you will find is that no descriptions or line items are returned.
Drilling down into the code, it's not easy to get at the raw XML response,
which is how your APOI docs are presented.
On the other hand, the following Python code does return the raw XML
which contains descriptions and line items.
I compared transaction details, trans_id by trans_id in both systems.
(sorry about the indentation, the original indentation apparently can't be replicated here)
for transaction_id in transaction_id_list:
request_xml = \
"""<?xml version="1.0" encoding="utf-8"?>
<getTransactionDetailsRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>""" + myAPILogin + """</name>
<transactionKey>""" + myTransactionKey + """</transactionKey>
</merchantAuthentication> <transId>""" + str(transaction_id) + """</transId>
</getTransactionDetailsRequest>"""
try:
request = urllib2.Request(
Authorize_Request_URL, request_xml,
{'Content-Type': 'text/xml'}
)
response = urllib2.urlopen(request)
except urllib2.URLError, err:
print(err.reason)
response_etree_root = objectify.parse(response).getroot()
if (not (response_etree_root.messages.resultCode == 'Ok')):
errmsg = "\n".join(list(response_etree_root.messages.message.itertext()))
# raise an error w/ errmsg
print ETree.tostring(response_etree_root, pretty_print=True)
I saw where a poster asked what's the sense in having an SDK that doesn't work,
and the response was probably correct...essentially pilot error.
But I think it would be fair to pose the same question with regard to the bug documented
above. What's the sense in publishing an SDK with such a serious bug?
07-07-2011 07:17 AM
Hi krc,
Thanks for the heads up. I'm sending your post on to the C# developers so that they can have a look and see what needs to be done here. Appreciate the feedback!
Thanks,
Michelle
Developer Community Manager
07-08-2011 03:55 PM