cancel
Showing results for 
Search instead for 
Did you mean: 

Stages when using x_relay_url with DPM, ASP.NET, and VB.NET

I am working on an ASP.NET/VB.NET site that will use DPM. I have plenty of experience with ASP.NET and VB.NET (and if necessary conversion to/from C#), but I need a COMPLETE example of what the code will look like in the following stages:

1. The Click eventhandler when submitting the form. I can obviously set the PostBackUrl if necessary, and I think (although I can't be sure at this point) I have the necessary values for all the fields, but I need to see the COMPLETE code for the handler so that I know I am not forgetting to do or include anything and am submitting it correctly.

2. The Load eventhandler (or whatever event I should be doing my stuff in after returning from the submission) of the page specified in the x_relay_url field. I need to know what information is available at that point, and what I need to check for. I want to see a complete realistic example of this.

I want to see complete, realistic, real-life examples of these pages so that I can correctly write the necessary code for my pages. Although I would prefer VB.NET, I will happily accept C# if that is all that it is available in. I would like both the *.aspx and codebehind code, although the codebehind is of more concern to me at this point. Any additional examples will be appreciated as well, but the submitting and response steps are the ones I am having trouble with. Thank you.

njsokalski
Contributor
3 REPLIES 3

Here's a working example in VB.NET: http://www.tandasoft.com/2011/05/05/using-authorize-net-dpm-direct-post-method-from-asp-net-web-form... .

 

My understanding is that it compiles and works under Visual Studio 2010, which is more than I can say for the ASP.NET MVC sample code from this site.

jonathanwood
Contributor

I tried that one, but I had a little trouble figuring out exactly how the response part worked. Also, it did not come with a *.sln or *.vbproj file, therefore not allowing me to open it as a project in Visual Studio (I am obviously able to view the files individually, but Visual Studio does not associate them with each other). I haven't tried it yet, but it looked like the most important line of code was:

 

Dim sr = New AuthorizeNet.SIMResponse(Request.Form)

 

I could probably manage to figure it out by testing, but can I ask what is included in Request.Form, and which fields in the SIMResponse are given values when this constructor is called? This example may eventually be enough, but it would be nice if I could have an example that I could view in Visual Studio as a project (and that had the *.aspx.designer.vb files). Thanks.

I'm not really sure what you're looking for here.

 

The complete source code for SimResponse is available here (although it may be C3), Request.Form is a collection of values posted to your form--this is a standard Webforms property and is very well documented.

 

I'm stuck on an issue myself which appears to be poorly and even incorrectly documented. But the points you made above are all spelled out pretty clearly.