Reply
Member
Posts: 5
Registered: ‎03-23-2011
Accepted Solution

C# SampleReporting can't get working "Invalid user" error

I downloaded the C# Transaction Details API sample program: https://developer.authorize.net/api/transaction_details/

But I cannot login to the live account for the Reporting sample even though the credentials work for the SampleAuthorization sample

 

I can get the SampleAuthorization code to work in C# for both LIVE and TEST accounts by changing the TRUE and FALSE variables under the new Gateway() object.

 

The problem is when I use the SampleReporting code it gives me the error:  "Error processing request: E00007 - User authentication failed due to invalid authentication values." even though I am using the exact same credentials that work for the SampleAuthorization code.

 

When trying the LIVE version it gives me the error mentioned above.  When trying the TEST credentials it tells me I have not enabled the account for API Reporting which I don't know how to do in the test account since it asks me for my pet's name and when I signed up for the test account it didn't ask me for a pet's name so i am unable to put one in.

 

I think the SampleReporting code tries to access the TEST server and  I don't know how to direct it to the LIVE server as I do in the SampleAuthorization 

 

What am I missing?


Accepted Solutions
Solution
Accepted by topic author mjcpp
‎08-21-2015 01:58 AM
Trusted Contributor
Posts: 451
Registered: ‎08-21-2009

Re: C# SampleReporting can't get working "Invalid user" error

You can adjust the following in order to get it to work with your production account credentials:

 

var gate = new ReportingGateway("APILOGIN", "TRANSACTIONKEY");

 

to:

 

var gate = new ReportingGateway("APILOGIN", "TRANSACTIONKEY", ServiceMode.Live);

 

 

Thank you,

 

Elaine

View solution in original post


All Replies
Member
Posts: 5
Registered: ‎03-23-2011

Re: C# SampleReporting can't get working "Invalid user" error

The ReportingGateway object has an overload for ServiceMode which has LIVE and TEST but I couldn't figure out how to use it.  I would think the sample would have addressed Live and Test servers as the SampleAuthorization did.

Solution
Accepted by topic author mjcpp
‎08-21-2015 01:58 AM
Trusted Contributor
Posts: 451
Registered: ‎08-21-2009

Re: C# SampleReporting can't get working "Invalid user" error

You can adjust the following in order to get it to work with your production account credentials:

 

var gate = new ReportingGateway("APILOGIN", "TRANSACTIONKEY");

 

to:

 

var gate = new ReportingGateway("APILOGIN", "TRANSACTIONKEY", ServiceMode.Live);

 

 

Thank you,

 

Elaine

Member
Posts: 5
Registered: ‎03-23-2011

Re: C# SampleReporting can't get working "Invalid user" error

Great, that worked.  I was sure I had tried that.

 

I have another problem now.  I can't seem to retrieve the list of transactions using the date overload.  Whether I use the simple () or the date overload I only get the last settled date.  Is this because I only started using the Reporting API now?  I can get individual Transactions using the string overload.

 

All of the next three only get the Transactions from my last settled Batch even though I think they should all get the last 30 days:

 

var transactions = gate.GetTransactionList();
var transactions = gate.GetTransactionList(DateTime.Today.AddDays(-31), DateTime.Today.AddDays(-1));
var transactions = gate.GetTransactionList(DateTime.Now.AddDays(-31), DateTime.Now.AddDays(-1));

Getting a specific Transaction by transaction ID works:

var transactions = gate.GetTransactionList("123456789");

 

 

All Star
Posts: 1,072
Registered: ‎08-17-2009

Re: C# SampleReporting can't get working "Invalid user" error

Hey there,

 

The SDK is doing what it should; it's getting a collection of all the settled batches and then retrieving the details on each batch and putting all the results into a List<Transaction> container.

I've got a couple of follow-up questions for you:

(1) Did you traverse through all the whole list - or just the first element?
(2) Do you have more than 1 settled batch?  I'm assuming so, but just asking for clarity.

I'd be curious to see what happens when you call GetSettledBatchList(DateTime from, DateTime to)?  Since this is the underlying call that  GetTransactionList(DateTime from, DateTime to) is calling.

 

Let me know!

 

Thanks,

 

Michelle

Developer Community Manager

Member
Posts: 2
Registered: ‎12-29-2011

Re: C# SampleReporting can't get working "Invalid user" error

Same here, i have this code, following your instruction :

 

DateTime ini = new DateTime(2011, 12, 23);
DateTime fin = new DateTime(2011, 12, 27);

ReportingGateway repo = new ReportingGateway("xxxxx", "yyyyy", ServiceMode.Live);

List<Batch> bts = repo.GetSettledBatchList(ini, fin);

foreach(Batch ba in bts)
{
List<Transaction> trns = repo.GetTransactionList(ba.ID);
foreach (Transaction t in trns)
lcInfo += t.TransactionID + "|" + t.TransactionType + "|" + t.InvoiceNumber + "|" + t.CustomerID + "|" +
t.OrderDescription + "|" + t.DateSubmitted + "|" + t.TransactionType + "|" + t.FirstName + " " +
t.LastName + "|" + t.SettleAmount  + Environment.NewLine;
}

 

But i just got the last settled batch.

 

Regards,

 

Mauricio Atanache.

Administrator Administrator
Administrator
Posts: 563
Registered: ‎08-03-2011

Re: C# SampleReporting can't get working "Invalid user" error

Hi,

 

I don't see anything obviously wrong with the code you are using, but there were some bugs with this function in an early version of the .Net SDK.  I recommend that you make sure you have the newest version.
Thanks,
Joy
Member
Posts: 2
Registered: ‎12-29-2011

Re: C# SampleReporting can't get working "Invalid user" error

You were right, i had an old dll, but by the way, please check the library download, in each example you can find diferent versions of the library, you guys should fix this issue.

 

Regards,

 

 

Mauricio Atanache G.

Administrator Administrator
Administrator
Posts: 563
Registered: ‎08-03-2011

Re: C# SampleReporting can't get working "Invalid user" error

Hi,

 

Thank you for that information, we will make sure to send this to our engineers to get updated.

 

Thanks,

Joy