cancel
Showing results for 
Search instead for 
Did you mean: 

DPM - Custom Receipt Page

I am using ASP .NET and have everything working up to the point of the receipt page. I took the asp example and converted it to .NET but I get a "Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.<br>Inner: Object reference not set to an instance of an object." when accessing the Request.Form variables.

 

Any ideas?

sands904
Contributor
28 REPLIES 28

What is on this SIM.aspx page?

 

I think all you need is  set x_Relay_response to false to use the authorize.net default receipt page.

The SIM.aspx page has all the logic to mark payments as received, etc in our application. I have to have that logic. There is nothing showing on the screen for that page however. Can I just display the receipt on that page? Any downside to that? will it work? What about if the client refreshest that page? Will it trigger the logic again...yes...?

I assume you are saving the response(Request.Form) on the SIM.aspx page to the Database. Just pass a unique random key to the reciept.aspx and read the data back from the database.

p.s. don't use response.redirect(), instead use a javascript redirect so the URL will change to your website.

We are not saving the form itself. We have most of the transaction information that we saved prior to submitting the card information. I guess we can just pull that back to show. What is the advantage of saving the form itself?

Not saving the form, just the response (e.g. Request.Form["x_response_code"]), you don't save the transactionID and/or authorization code?

Yes, we are saving the Request["x_trans_id"]. We could save the auth code also. Then I guess we should just pull our info from the database? and if we need anything else from the response that we are not currently saving we will have to save it. Thanks for all the help.

Or you can just pass it on the URL, if you have no reason to save those other info.

Okay that will work too. Is there a specific way you recommend to do the javascript redirect? or just the basic?

 

<script type="text/javascript">
<!--
window.location = "http://www.google.com/"
//-->
</script>

That would work if you don't need to pass any url param

 

If you want to add something to the url do something like this on the page_load.

string _jscript = "<script type=\"text/javascript\">window.location = 'http://www.website.com?secretkey="+ "12345"+"';</script>";
ClientScript.RegisterClientScriptBlock("".GetType(), "s", _jscript);