Question

How Can I find whether the transaction made by user is settled or Unsettled in the authorize.net.I am using AIM. I want to get through coding.When the transaction is completed and I cant find transaction status.But I want to get whether it goes for settled or unsettled transaction. Thanks in advance.

Was it helpful?

Solution

You cannot get this information through coding as no API Authorize.Net offers allows for this. It can only be done through the control panel. When you process a transaction and it is approved you can assume the transaction is unsettled. Transactions are settled once per day usually around midnight Pacific Time. After that you can assume a transaction is settled.

OTHER TIPS

As of 03-16-2011 authorize.net has released two new calls to the Transaction Details API, getUnsettledTransactionList and getBatchStatistics.

getUnsettledTransactionList returns up to 1,000 unsettled transactions per call, returning the most recent transactions. The information returned in the response will be the same as what's returned in getTransactionList call.

getBatchStatistics returns the batch stats for a single batch like settlement state and time, charge count, decline count, etc.

For more info, check out the XML guide and the SOAP guide.

At the time of writing the PHP SDK is at version 1.1.6 and does not have this function built into the TD api, however if you look at the documentation provided above, as well as this example page, you will see that getting a list of unsettled transactions is in fact possible.

from this page

I've followed this link http://developer.authorize.net/api/transaction_details/ and get this code from there,

<?php
require_once "anet_php_sdk/AuthorizeNet.php";
define("AUTHORIZENET_API_LOGIN_ID", "YOURLOGIN");
define("AUTHORIZENET_TRANSACTION_KEY", "YOURKEY");

// 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 = "12345";
$response = $request->getTransactionDetails($transactionId);
echo $response->xml->transaction->transactionStatus;

but I m getting this error message.

User authentication failed due to invalid authentication values.

As suggested in @cwd's answer, the most reliable way to know if a transaction is settled is to call getUnsettledTransactionList or getBatchStatistics, but you can also just check what your Transaction Cut-off Time is set to.

Log in to your Authorize.net admin, click Account > Transaction Cut-Off Time

My account is set to 4:00 PM PDT so you can just compare your transaction time to the cut off time. Something like:

$createdTime = new DateTime($charge['createdTime']);

// starting point for settle time
$settleTime = new DateTime($createdTime->format('Y-m-d') . ' 16:00:00');
$now = new DateTime();

// if card was charged after settle time for 
// that day, move settle time to the next day
if ($createdTime > $settleTime) {
    $settleTime->add(new DateInterval('P1D'));
}

if ($now > $settleTime) $settled = true;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top