Reply
Highlighted
Member
Posts: 1
Registered: ‎01-31-2012

DPM with ASP.NET 4.0

[ Edited ]

Hi,

 

I have been looking into an given sample of integerating DPM with the ASP.NET

http://www.tandasoft.com/2011/05/05/using-authorize-net-dpm-direct-post-method-from-asp-net-web-form...

 

And the code remains the same except I made changes to the API ID and transcation key to my test account.

I am getting an error when I click on complete Purchase Button in the given sample

 

"An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card. 

      This transaction cannot be accepted. "

 

following are the parameters:

<input type="hidden" name="x_fp_hash" value="a77bb7c3eccfa65d7d563a70cb27c341">

<input type="hidden" name="x_fp_sequence" value="971">

<input type="hidden" name="x_invoice_num" value="1"> <input type="hidden" name="x_fp_timestamp" value="1328073203">

<input type="hidden" name="x_login" value="5kXdR5J7JZ">

<input type="hidden" name="x_relay_url" value="http://localhost/Payment/SIM.aspx">

<input type="hidden" name="x_relay_response" value="TRUE"> <input type="hidden" name="x_receipt_link_url" value="http://localhost/Payment/Thanks.aspx"> <input type="hidden" name="x_test_request" value="TRUE">

<input type="hidden" name="x_method" value="CC">

<input type="hidden" name="x_type" value="AUTH_CAPTURE">

<input type="hidden" name="x_first_name" value="John">

<input type="hidden" name="x_last_name" value="Doe">

<input type="hidden" name="x_address" value="123 Main St">

<input type="hidden" name="x_city" value="Anywhere">

<input type="hidden" name="x_state" value="CO">

<input type="hidden" name="x_zip" value="12345"> <input type="hidden" name="x_amount" value="12.34">



 

Would you please assist on it that what would be the wrong 

 

Highlighted
Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: DPM with ASP.NET 4.0

There's a variety of reasons you could be getting that error. For instance, the fingerprint could have expired (the time zone of the time stamp needs to match the time zone inside your account, I believe), the fingerprint could have already been used, the fingerprint could be incorrect (maybe you didn't pass everything to the fingerprint function properly), etc. Would be helpful to see your code, and also a var dump of your output, specifically the second error code (probably 97, 98, or 99, but we need to know which).

Highlighted
Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: DPM with ASP.NET 4.0

[ Edited ]

Oh, your relay response page could also be timing out, which could be caused by a variety of reasons as well, perhaps a slow nameserver or slow hosting.

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: DPM with ASP.NET 4.0

Highlighted
Member
Posts: 5
Registered: ‎12-22-2011

Re: DPM with ASP.NET 4.0

Hi Raynor,

 

I got the above problem solved it was the problem with the timestamp.

If I set the relay response = false and doesn't provide any value for the response url and just provide the url for the receipt url ,I can see the Authorize.NET receipt

 

Now,Problem is ,I want to show my own page with the response I got from Authorize.Net when I click on complete the page.

So,I set the realy response to true and pass ed the relay response to server/websitename/SIM.aspx as shown in the sample eaxample link I posted earlier and keeping the receipt url too.

This time When I hit the complete purchase button ,the url redirect to Error.aspx,this is what i see in url :servername/Error.aspx?cc=1&msg=Validation+failed%3a(TESTMODE)+This+transaction+has+been+approved.%2c+ResponseCode%3a1

 

in SIM.aspx page page_load I have:

var sr = new AuthorizeNet.SIMResponse(Request.Form);
if (! sr.Approved)
EndWithRedirect(GetApplicationURL() + "Warning.aspx?msg=" + HttpUtility.UrlEncode("Credit card authorization denied: " + sr.Message + ", ResponseCode:" + sr.ResponseCode));

if (! sr.Validate(ConfigurationManager.AppSettings.GetValues("AUTHORIZE_NET_MD5_HASH")[0], ConfigurationManager.AppSettings.GetValues("AUTHORIZE_NET_API_LOGIN")[0]) )
EndWithRedirect(GetApplicationURL() + "Error.aspx?cc=1&msg=" + HttpUtility.UrlEncode("Validation failed:" + sr.Message + ", ResponseCode:" + sr.ResponseCode));

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: DPM with ASP.NET 4.0

So it failing on sr.Validate()? Check the MD5 Hash setting?