cancel
Showing results for 
Search instead for 
Did you mean: 

C# Example Not Working

Background:  I'm trying to configure my system to work with the sandbox environment so we can actually test our integration with the Authorize.Net API.

 

So I've copied the C# example from the http://developer.authorize.net/hello_world/ page into a new application in visual studio, but it doesn't work. 

 

Specifically, these two lines:

 

ApiOperationBase.RunEnvironment = AuthorizeNet.Environment.SANDBOX;

// define the merchant information (authentication / transaction id)
ApiOperationBase.MerchantAuthentication = new merchantAuthenticationType()

 

Whenever I try to build the application, I receive the following error:

Using the generic type 'ApiOperationBase<TQ, TS>' requires 2 type arguments

 

Has anyone  else experienced this with the example code?  If so, how did you resolve it?

 

As additional info, I've tried this example code with both the 1.8.8 nuget package and the 1.9 nuget package.

 

Thanks for any help!

 

~John

jhesch
Member
1 REPLY 1

Ok, I found the answer in the actual code that's on GitHub... 

 

Basically, the lines I mentioned in the original post need to be replaced with:

 

ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;

// define the merchant information (authentication / transaction id)
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()

 

I'm not sure if anyone who updates the web site reads this forum, but if you could get someone to update the web page so the information is accurate, it might help future users.

 

~John

jhesch
Member