cancel
Showing results for 
Search instead for 
Did you mean: 

Examples of multiple functions on the same page

I have one C# code page with all of my Authorize.Net functions on it.  In each function i have to have 

ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
            ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()
            {
                name            = ApiLoginID,
                ItemElementName = ItemChoiceType.transactionKey,
                Item            = ApiTransactionKey,
            };

Is there some way i can add this to the top of the page, in private variables?  Is it possible to pass in the ApiOperationBase information, so i dont have to repeat the code in every function?

 

Thanks

mts176
Member
1 REPLY 1

Hi 

 

ApiOperationBase is the base class used for all API calls and its has 2 static properties 

 

RunEnvironment & MerchantAuthentication which can be set only once and need not be in each function.

 

Hope this help !

kikmak42
Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert