cancel
Showing results for 
Search instead for 
Did you mean: 

Authorize AIM In MVC 5

Hi All,

 

Please any one help me...

how to integrate authorize.net AIM for any simple integration in MVC 5.

Previcous i done in php (integration for AIM) but know we want in .NET with MVC 5.

Please send any articles to integrate.

 

Thanks in Advance...

 

Mubeena

Mubeena123
Member
6 REPLIES 6

Hi,

 

You could check out the SDK https://github.com/AuthorizeNet/sdk-dotnet and the sample code at https://github.com/AuthorizeNet/sample-code-csharp

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

Hi,

 

Thanks for your reponse...

am trying this url

 http://samridhis.blogspot.in/2011/01/authorizenet-integration-ecommerce.html

but getting error in controller with response.Validate(....) here.

 

Thanks,

Mubeena

 

Mubeena123
Member

What is the error you are getting?

Powered by NexWebSites.com -
Certified Authorize.net developers

Am getting this errors in home controller 

1) Error 1 'AuthorizeNet.SIMResponse' does not contain a definition for 'Validate' and no extension method 'Validate' accepting a first argument of type 'AuthorizeNet.SIMResponse' could be found (are you missing a using directive or an assembly reference?) C:\Users\mubee\documents\visual studio 2013\Projects\Authocsharp\Authocsharp\Controllers\HomeController.cs 22 36 Authocsharp

 

2) Error 2 'Authocsharp.Controllers.AuthorizeNET' does not contain a definition for 'Helpers' C:\Users\mubee\documents\visual studio 2013\Projects\Authocsharp\Authocsharp\Controllers\HomeController.cs 25 41 Authocsharp

Mubeena123
Member

 

The Validate method was removed from the SIMResponse. To enable it ...

 

The following should be added to :  /Authorize.NET/AIM/Responses/SIMResponse.cs

public bool Validate(string merchantHash, string apiLogin) {
          return Crypto.IsMatch(merchantHash, apiLogin, this.TransactionID, this.Amount, this.MD5Hash);
       }
 

and the following should be added to : /Authorize.NET/Utility/Crypto.cs 

public static bool IsMatch(string key, string apiLogin, string transactionID,decimal amount, string expected) {
            var unencrypted = string.Format("{0}{1}{2}{3}", key, apiLogin, transactionID, amount.ToString());
           var md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
            var hashed = Regex.Replace(BitConverter.ToString(md5.ComputeHash(ASCIIEncoding.Default.GetBytes(unencrypted))), "-", "");
              return hashed.Equals(expected);
       }

 

Powered by NexWebSites.com -
Certified Authorize.net developers

Hi,

 

i added like you said but am getting null from  'response' like message, approved - false, response code,MD5Hash = null all variable getting null.

 

Thanks,

Mubeena

Mubeena123
Member