cancel
Showing results for 
Search instead for 
Did you mean: 

Missing Directive

I am new to Authorize.NET and am attempting DPM, ASP.NET MVC3, C#. 

 

When compiling my solution, I get two errors that underscore AuthorizeNET in two places in HomeController.cs, and is telling me that I am missing a directive or refererence for the namespace AuthorizeNet.  The AuthorizeNET.DLL  reference is created and the web.config is configured with the AuthorizeNET.helpers namespace.

 

HERE IS THE CODE THAT FAILS, highlighted in bright red, first and last lines in the braces:

[

AcceptVerbs(HttpVerbs.Post)]

       

publicActionResult Sim(FormCollection post)

        {

           

var response = new AuthorizeNET.SIMResponse(post);

           

//first order of business - validate that it was Auth.net that posted this using

           

//the MD5 hash that was passed back to us

           

var isValid = response.Validate("", "6343LUe4Q9jf");

           

//if it's not valid - just send them to the home page. Don't throw - that's how

           

//hackers figure out what's wrong :)

           

if (!isValid)

               

return Redirect("http://www.avtec.edu");

           

//the URL to redirect to- this MUST be absolute

           

var returnUrl = "http://secure.avtec.edu/?m=" + response.Message;

           

return

            Content(AuthorizeNET.Helpers.CheckoutFormBuilders.Redirecter(returnUrl));

        }

 

SFink
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

It a typo, AuthorizeNet

var response = new AuthorizeNET.SIMResponse(post);

is lower case "et" as in AuthorizeNet.SIMResponse(post);

 

 

 


View solution in original post

9 REPLIES 9

Did you move the dll from the reference location?

RaynorC1emen7
Expert

I did not.

 

If I do remove it, I get all kinds of errors.  Those errors resolve when I add it, EXCEPT for these two in question. 

 

Also, is there a difference between the dll found in the bin folder vs. the obj folder?  I tried both, but just asking.

did it have the

using AuthorizeNet; 

Not sure about obj folder but I always use the one in bin folder.

yep, included that and for kicks added the other classes available, so there are three.

 

using AuthorizeNet;

using AuthorizeNet.APICore;

using AuthorizeNet.Helpers;

 

I doubt it is necessary, but it shoudln't do any harm either. ???? 

 

And, yes I too am using the .dll from the bin folder. 

Not sure what else to check.

It a typo, AuthorizeNet

var response = new AuthorizeNET.SIMResponse(post);

is lower case "et" as in AuthorizeNet.SIMResponse(post);

 

 

 


AAAAAHAAAAAAA!!!!!

 

Thanks Raynor.  This was not my typo, but a typo in the Quick Start Guide from where I copied the code.

 

See: https://developer.authorize.net/integration/fifteenminutes/csharp

 

:smileylol:

 

You have been a big help!

 

Raynor,

I have contacted Authorize.net support and alerted them to the typo.  I gave you the credit for discovering it.

:smileyhappy:

Hi,

 

Thank you for this information, we will make sure to get this updated.

 

Thanks,

Joy

Joy
Administrator Administrator
Administrator