I am attempting to pull transaction and batchlist data from PHP. I have a live account and valid API Login and Key. And I have actvated the Transaction Details API.
This accout has been LIVE for years and has many transactions and batches. However, I get 0Batches and no details using a known valid transaction ID.
echo "<br>****** Authorize.Net ******<br>"; require_once "../../anet_php_sdk/AuthorizeNet.php"; define("AUTHORIZENET_API_LOGIN_ID", "***********"); define("AUTHORIZENET_TRANSACTION_KEY", "****************"); // 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 = "6356645336"; $response = $request->getTransactionDetails($transactionId); echo $response->xml->transaction->transactionStatus;
Any thoughts on why? I activated Transaction Details API this morning. Does it take time to take effect?
07-24-2014 09:14 AM
Have you try just echo the $response to see if there is anything return?
07-24-2014 09:49 AM
An echo $response returns nothing.
Is there a public developer test api_login_id and transactions_key and transaction id I can use to ensure the code is sound?
07-25-2014 08:27 AM
there isn't a public one, but you get a new test sandbox account
07-25-2014 08:30 AM
Yeah. I have had a sandbox account as well as two live accounts that have been around for years.
Is there any documentation on the $response object that can assist is debug? It seems od to just get nothing. No errors, nothing. Perhaps there is documentation on that 'nothing' means.
07-25-2014 08:36 AM
It the response is blank, you could look at the php code and see where it failing. One of the thing they did recently was response with gzip compression if your request header ask for it.
07-25-2014 08:52 AM - edited 07-25-2014 08:52 AM
"...look at the php code and see where it failing..."
The only code I am using is the code they provide.
require_once "../../anet_php_sdk/AuthorizeNet.php"; define("AUTHORIZENET_API_LOGIN_ID", "*********"); define("AUTHORIZENET_TRANSACTION_KEY", "**********"); // 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 = "6356645336"; $response = $request->getTransactionDetails($transactionId); echo $response->xml->transaction->transactionStatus; echo $repsonse;
The code isn't indicating an error. Only that there is no data to return and echo. I know there are hundreds of batchs and transactions.
"...response with gzip compression if your request header ask for it..."
I'm not sure what you mean. Can you expound on this?
Thank you again for your replies. It is appriciated.
07-25-2014 08:57 AM
Addtional Note:
I used a developer sandbox account credentials and it returns the exact same scenario. The Authorize.net sample.php code for various functionality seem to work fine with those developer sandbox account credentials.
07-25-2014 09:05 AM
...look at the php code and see where it failing..."
The only code I am using is the code they provide.
When you download the php sdks, it should be the code too?
"...response with gzip compression if your request header ask for it..."
I'm not sure what you mean. Can you expound on this?
07-25-2014 09:07 AM - edited 07-25-2014 09:09 AM
Thanks for the link. It does appear that :
gzip compression | enabled |
So I will look into the solution that was posted in your link, and I'll be back here with results.
07-25-2014 09:15 AM