I've been struggling to get this up and running for several days now. Can anyone help?
I'm using ASP.NET MVC and the DPM API. But the response back from the server doesn't validate.
Here's some sample code. The hard-coded values are ones returned in the post form data. The first two arguments hold the values I was given when I created my test account. The transaction is approved, but the code below sets ok to false! Can anyone see where I've gone awry?
bool ok = Crypto.IsMatch(AuthorizeNetAccount.TransactionKey, AuthorizeNetAccount.LoginId, "2170482722", 99.99M, "D49924634EE78B8427CC1C17635917E0");
Thanks for any suggestions.
Solved! Go to Solution.
04-02-2012 01:20 PM
The first param is your MD5 setting(set in the merchant account settings), not the transactionKey.
04-02-2012 01:28 PM
The first param is your MD5 setting(set in the merchant account settings), not the transactionKey.
04-02-2012 01:28 PM
Thanks much for the reply. However, I'm still a bit confused. Here's some code from the SDK download I got from the Authorize.NET website.
public bool Validate(string merchantHash, string apiLogin) { return Crypto.IsMatch(merchantHash, apiLogin, this.TransactionID, this.Amount, this.MD5Hash); }
Isn't the last argumet the MD5?
04-02-2012 02:48 PM
The first one is your merchant account md5 hash setting. The last one is the relay response MD5 hash.
04-02-2012 03:58 PM
This is fantastic if correct! So how do I get my merchant hash?
I got several hashes when I signed up but didn't see any labelled "merchant hash".
04-02-2012 04:01 PM
Try blank if it is not set.
Or login to your merchant. Under Account - Settings - Security Settings - MD5 Hash and change it.
04-02-2012 04:32 PM