So, here is the code we were given to use. I know that the ID and key are correct because I plugged them into the sample.php and successfully posted a transaction. What we are trying to do is retrieve batch information from Authorize.net in order to build a data file that we can then use to import into our database. As of right now all it says is "0 batches" when I know there is a settled batch in this account. Any idea what we're doing wrong? Everything in the SDK is still at default options.
<?php
require_once "anet_php_sdk/AuthorizeNet.php";
define("AUTHORIZENET_API_LOGIN_ID", "1234AaBb1234");
define("AUTHORIZENET_TRANSACTION_KEY", "1234AaBb1234AaBb");
// Get Settled Batch List
$request = new AuthorizeNetTD;
$response = $request->getSettledBatchList();
echo count($response->xml->batchList->batch) . " batches\n";
foreach ($response->xml->batchList->batch as $batch) {
echo "Batch ID: " . $batch->batchId . "\n";
}
// Get Transaction Details
$transactionId = "9999999999";
$response = $request->getTransactionDetails($transactionId);
echo $response->xml->transaction->transactionStatus;
// Tests
//echo $response;
//--------------------------------------------------
?>
Solved! Go to Solution.
07-14-2014 01:11 PM
I enabled Transaction Details API. It works now.
07-14-2014 01:39 PM
Need to enabled TransactionDetail API on the merchant account. Login to it, and go to account settings.
07-14-2014 01:39 PM
I added print_r($response); and got this:
AuthorizeNetTD_Response Object ( [xml] => SimpleXMLElement Object ( [messages] => SimpleXMLElement Object ( [resultCode] => Error [message] => SimpleXMLElement Object ( [code] => E00011 [text] => Access denied. You do not have permissions to call the Transaction Details API. ) ) ) [response] => ErrorE00011Access denied. You do not have permissions to call the Transaction Details API. [xpath_xml] => SimpleXMLElement Object ( [messages] => SimpleXMLElement Object ( [resultCode] => Error [message] => SimpleXMLElement Object ( [code] => E00011 [text] => Access denied. You do not have permissions to call the Transaction Details API. ) ) ) )
07-14-2014 01:34 PM
I enabled Transaction Details API. It works now.
07-14-2014 01:39 PM
Need to enabled TransactionDetail API on the merchant account. Login to it, and go to account settings.
07-14-2014 01:39 PM