cancel
Showing results for 
Search instead for 
Did you mean: 

PHP Batch Information

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;

//--------------------------------------------------
?>

foundation406
Contributor
2 ACCEPTED SOLUTIONS

Accepted Solutions

I enabled Transaction Details API. It works now.

View solution in original post

Need to enabled TransactionDetail API on the merchant account. Login to it, and go to account settings.

View solution in original post

3 REPLIES 3

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. ) ) ) )

foundation406
Contributor

I enabled Transaction Details API. It works now.

Need to enabled TransactionDetail API on the merchant account. Login to it, and go to account settings.