Reply
Highlighted
Member
Posts: 5
Registered: ‎06-29-2016

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

Highlighted
Posts: 459
Topics: 0
Kudos: 92
Blog Posts: 0
Ideas: 0
Solutions: 36
Registered: ‎04-28-2017

Re: Authorize AIM In MVC 5

[ Edited ]

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
Highlighted
Member
Posts: 5
Registered: ‎06-29-2016

Re: Authorize AIM In MVC 5

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

 

Highlighted
Posts: 459
Topics: 0
Kudos: 92
Blog Posts: 0
Ideas: 0
Solutions: 36
Registered: ‎04-28-2017

Re: Authorize AIM In MVC 5

What is the error you are getting?

Powered by NexWebSites.com -
Certified Authorize.net developers
Highlighted
Member
Posts: 5
Registered: ‎06-29-2016

Re: Authorize AIM In MVC 5

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

Highlighted
Posts: 459
Topics: 0
Kudos: 92
Blog Posts: 0
Ideas: 0
Solutions: 36
Registered: ‎04-28-2017

Re: Authorize AIM In MVC 5

 

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
Highlighted
Member
Posts: 5
Registered: ‎06-29-2016

Re: Authorize AIM In MVC 5

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