Reply
Highlighted
Contributor
Posts: 22
Registered: ‎06-17-2014

C# - Data differences between GetTransactionList() and GetTransactionDetails()

So when I do a lookup using GetTransactionList(), I get a list of all the transactions for the last 30 days including First and Last Name with each transaction.

 

If I then lookup a specific transaction using GetTransactionDetails() and give it a specific transaction to look up, what is returned does not include the customer's first and last name.  All I get are null values for first and last name.

 

Why is there a difference between these two methods on what data is returned?

 

Thanks in advanced!

 

-Pedro Coelho

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

Re: C# - Data differences between GetTransactionList() and GetTransactionDetails()

https://api.authorize.net/soap/v1/Service.asmx?WSDL

are you looking at the right location? on the getTransactionList is on the summary list, while getTransactionDetails is in the bill to

Highlighted
Contributor
Posts: 22
Registered: ‎06-17-2014

Re: C# - Data differences between GetTransactionList() and GetTransactionDetails()

I don't understand what you're asking whether I'm looking in the right location.

 

I'm using the Authorize.Net dll, not the webservice.  I tried modifyiing my code to use the webservice, but I wasnt having any luck with it.

 

My code is below.... its a little weird how I'm doing it.  When I can GetTransactionList, I iterate through the list of transactions, add them to a datatable then bind that datatable to a gridview.  I did this for testing purposes.

 

I'm searching for a transaction based on a particular Invoice#, hence all the looping.  I hope you understand my code.

 

The point it, that when I run this I get a FirstName from GetTransactionList, but when I specifically look for a transaction using GetTransactionDetails, the FirstName is blank.

 

Any help would be appeciated.  Thanks.

 

        protected void cmdGetData_Click(object sender, EventArgs e)
        {
            string sOrderNumber = txtOrderNumber.Text.ToString();
            string sTransactionID = "";

            var login = ConfigurationManager.AppSettings["AuthorizeNetApiLogin"];
            var transactionKey = ConfigurationManager.AppSettings["AuthorizeNetTransactionKey"];

            var gate = new ReportingGateway(login, transactionKey, ServiceMode.Test);

            //Date Range cannot exceed 31 days
            var transactions = gate.GetTransactionList();

            

            DataColumn dcInvoiceNumber = new DataColumn("InvoiceNumber");
            DataColumn dcTransactionNumber = new DataColumn("TransactionNumber");
            DataColumn dcFirstName = new DataColumn("FirstName");
            DataColumn dcLastName = new DataColumn("LastName");
            DataColumn dcAmount = new DataColumn("Amount");
            DataColumn dcDateSubmitted = new DataColumn("DateSubmitted");
            DataColumn dcCount = new DataColumn("Count");

            dcInvoiceNumber.DataType = System.Type.GetType("System.String");
            dcTransactionNumber.DataType = System.Type.GetType("System.String");
            dcFirstName.DataType = System.Type.GetType("System.String");
            dcLastName.DataType = System.Type.GetType("System.String");
            dcAmount.DataType = System.Type.GetType("System.String");
            dcDateSubmitted.DataType = System.Type.GetType("System.String");
            dcCount.DataType = System.Type.GetType("System.String");

            DataTable data = new DataTable();
            data.Columns.Add(dcInvoiceNumber);
            data.Columns.Add(dcTransactionNumber);
            data.Columns.Add(dcFirstName);
            data.Columns.Add(dcLastName);
            data.Columns.Add(dcAmount);
            data.Columns.Add(dcDateSubmitted);
            data.Columns.Add(dcCount);

            int i = 1;

            foreach (var item in transactions)
            {
                DataRow row = data.NewRow();
                row[dcInvoiceNumber] = IsNull(item.InvoiceNumber);
                row[dcTransactionNumber] = IsNull(item.TransactionID);
                row[dcFirstName] = IsNull(item.FirstName);
                row[dcLastName] = IsNull(item.LastName);
                row[dcAmount] = IsNull(item.SettleAmount);
                row[dcDateSubmitted] = IsNull(item.DateSubmitted);
                row[dcCount] = i.ToString();

                data.Rows.Add(row);
                i++;

                //sTransactionID = item.TransactionID.ToString();

                if (IsNull(item.InvoiceNumber) == sOrderNumber)
                {
                    sTransactionID = item.TransactionID.ToString();
                }
            }

            gvData.DataSource = data;
            gvData.DataBind();

            //If Transaction Found, Display all Transaction details
            if (sTransactionID != "")
            {
                //Display DIV with details
                Transaction tran = gate.GetTransactionDetails(sTransactionID);

                lblOrderNumber.Text = IsNull(tran.InvoiceNumber);
                lblDateSubmitted.Text = IsNull(tran.DateSubmitted);

                lblFirstName.Text = IsNull(tran.FirstName);
                lblLastName.Text = IsNull(tran.LastName);
                lblBankName.Text = IsNull(tran.BankNameOnAccount);

                lblShipping.Text = IsNull(tran.Shipping);
                lblTax.Text = IsNull(tran.Tax);
                lblTotal.Text = IsNull(tran.SettleAmount);
                
                lblTransactionID.Text = IsNull(tran.TransactionID);
                lblTransactionType.Text = IsNull(tran.TransactionType);
                lblTransactionStatus.Text = IsNull(tran.Status);
                lblAuthorizationCode.Text = IsNull(tran.AuthorizationCode);
                lblPaymentMethod.Text = IsNull(tran.CardType) + " " + IsNull(tran.CardNumber);

                divOrderDetails.Visible = true;
                lblMessage.Visible = false;

                Session["CpOrderID"] = tran.InvoiceNumber;
                Session["TransactionID"] = tran.TransactionID;
                Session["AuthorizationCode"] = tran.AuthorizationCode;
                Session["OrderAmount"] = tran.SettleAmount;

                //Variables from Stored Proc
                //@CpOrderId int=null,
                //@UpdatedBy int =null,
                //@PaymentTypeId int=null,
                //@TransactionID varchar(50)=null,
                //@AuthorizationCode varchar(30)=NULL,
                //@OrderAmount DECIMAL(18,2)=NULL
            }
            else
            {
                lblMessage.Visible = true;
                divOrderDetails.Visible = false;

                Session["CpOrderID"] = null;
                Session["TransactionID"] = null;
                Session["AuthorizationCode"] = null;
                Session["OrderAmount"] = null;
            }


        }

 

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

Re: C# - Data differences between GetTransactionList() and GetTransactionDetails()

   //If Transaction Found, Display all Transaction details
            if (sTransactionID != "")
            {
                //Display DIV with details
                Transaction tran = gate.GetTransactionDetails(sTransactionID);

                lblOrderNumber.Text = IsNull(tran.InvoiceNumber);
                lblDateSubmitted.Text = IsNull(tran.DateSubmitted);

                lblFirstName.Text = IsNull(tran.FirstName);
                lblLastName.Text = IsNull(tran.LastName);

tran have a "bill to", first name and last name is in them. You can either see it in the WSDL or read the doc

 

Or you can see it in the source, those 2 fields only fill in if it is from the transaction summary.

https://github.com/AuthorizeNet/sdk-dotnet/blob/master/Authorize.NET/Reporting/Transaction.cs

 

Highlighted
Contributor
Posts: 22
Registered: ‎06-17-2014

Re: C# - Data differences between GetTransactionList() and GetTransactionDetails()

I do not see BillTo in Intellisence.  The only thing I can think of is that maybe I'm not using the latest version of the Autorize.net dll.

 

Do you know where I can get the latest version?

Highlighted
Contributor
Posts: 22
Registered: ‎06-17-2014

Re: C# - Data differences between GetTransactionList() and GetTransactionDetails()

Forget it, thats not the reason.  I have the latest version of the dll.

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

Re: C# - Data differences between GetTransactionList() and GetTransactionDetails()

Highlighted
Contributor
Posts: 22
Registered: ‎06-17-2014

Re: C# - Data differences between GetTransactionList() and GetTransactionDetails()

Thanks for the help.... but I do find it strange how it is setup.  Its not consistent at all.

 

Thanks again!

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

Re: C# - Data differences between GetTransactionList() and GetTransactionDetails()

That why I like doing my own code, then I know exactly what to expect.