Trying to show a summary of statistics on my server for our accounting department. Reading through the forums and guides, I am a bit stuck. In the XML documentation, the responses seem to indicate that I should be able to look through the statistics for each batch. I have tried several methods to try and see this. Can someone kind of suggest a tip to help me along? Below is my code:
<?php
error_reporting(E_ALL);
require_once "/anet_php_sdk/AuthorizeNet.php";
define("AUTHORIZENET_API_LOGIN_ID", "xxxxxxxxx");
define("AUTHORIZENET_TRANSACTION_KEY", "xxxxxxxxxxx");
define("AUTHORIZENET_SANDBOX", false);
// Get Settled Batch List
$request = new AuthorizeNetTD;
$includeStatistics = true;
$firstSettlementDate = "2014-07-01T08:15:30";
$lastSettlementDate = "2014-07-09T08:15:30";
$response = $request->getSettledBatchList($includeStatistics,$firstSettlementDate,$lastSettlementDate);
echo count($response->xml->batchList->batch) . " batches<br>";
foreach ($response->xml->batchList->batch as $batch) {
echo "Batch ID: " . $batch->batchId . "<br>";
// I would like to put in the Transaction details here and tried : $response->xml->statistics=>statistic->accountType
}
// Tried looping through the statistics in the response, and also in the above batch list (which works fine) loop, and also have tried just displaying in on the page - something like:
foreach ($response->xml->statistics->statistic as $stat) {
echo "Account Type: " . $stat->accountType . "<br>";
}
?>
โ07-10-2014 11:56 AM
โ07-10-2014 12:46 PM
Thank you. That helped a lot.
So, then, I should be able to then loop through each batch and see a summary of each accountType, chargeAmount, and chargeCount ?
I appreciate the reply.:smileyhappy:
โ07-10-2014 01:02 PM
That sound right.
โ07-10-2014 01:19 PM