Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 7
Registered: ‎07-24-2012

GetTransactionDetails returns Transaction object instead of GetTransactionDetailsResponse object

Hi - i'm using version 1.7 of the SDK (authorizenet.dll).   we are building an application and are trying to automate the process of retrieving chargeback and/or refunds that occur outside of our application.  currently, we'll have  a job that will run though and check to see if there were any reversals for the given time period so we can update our system accordingly.  i'm able to get the batch items that settled during the period and can check to see if there were any reversal items in the batch.  if there were then i'm getting all transactions in the batch and looping through them to find the transaction that was reversed.  when i get to the reversed item i need to know the orig trans id and the new trans id. 

according to the documentation the GetTransactionDetailsResponse   object should include:

transId The transaction ID
refTransID The transaction ID of the original transaction  this only appears for linked credits (transaction type refundTransaction)

however, it seems the return object is simply a Transaction object as opposed to the GetTransactionDetailsResponse  return object.  this is causing me to not be able ot obtain the original transaction id.  when i try casting the return object to a GetTransactionDetailsResponse  it says that it's an invalid cast.


i'm sure i'm doing something silly but i've been stuck a few days.  also, if there is an easier way to obtain refunded/chargeback/returned items that would be great.

 

any advice is appreciated!  thanks in advance.

 

jeff

 

 

here is my code.

var gate = new ReportingGateway(ApiLoginKey, ApiTransactionKey);
//Get all the batches settled
var batches = gate.GetSettledBatchList(beginDate, endDate,false);
//Loop each batch returned
foreach (var item in batches)
{
    foreach (var chg in item.Charges)
    {
        if (chg.ChargeBackCount > 0 || chg.RefundAmount > 0)
        {
            //need to get individual items that were returned
            var transactions = gate.GetTransactionList();
            foreach (var transaction in transactions)
            {
                //only test for refunded or chargeback items
                switch (transaction.Status)
                {
                    case "refundSettledSuccessfully":
                    case "chargeback":
                        //we need to add this to the list of items
                        var transactionDetails = gate.GetTransactionDetails(transaction.TransactionID);
                        ***//here transactionDetails is a Transaction object instead of a GetTransactionDetailsResponse object
                        break;
                }

            }

        }
    }
}

 

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: GetTransactionDetails returns Transaction object instead of GetTransactionDetailsResponse objec

Download the source and change it.

If all you need is the transaction detail API. It might be easier just to use the web service call and skip the SDKs.