Reply
Contributor
Posts: 18
Registered: ‎07-14-2014
Accepted Solution

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;

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


Accepted Solutions
Solution
Accepted by topic author foundation406
‎08-21-2015 01:58 AM
Contributor
Posts: 18
Registered: ‎07-14-2014

Re: PHP Batch Information

I enabled Transaction Details API. It works now.

View solution in original post

Solution
Accepted by topic author foundation406
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: PHP Batch Information

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

View solution in original post


All Replies
Contributor
Posts: 18
Registered: ‎07-14-2014

Re: PHP Batch Information

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

Solution
Accepted by topic author foundation406
‎08-21-2015 01:58 AM
Contributor
Posts: 18
Registered: ‎07-14-2014

Re: PHP Batch Information

I enabled Transaction Details API. It works now.

Solution
Accepted by topic author foundation406
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: PHP Batch Information

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